B
Brad E.
Hi,
Two worksheets ("Entry" and "TABLES")
Entry!A1 = user-entered date
Entry!A2 = a Match formula to find which column to use on TABLES
(calculates to 2 for the date I have entered)
TABLES column A = my header column for all date entries
TABLES column B-F = entries which differ depending on date
TABLES row 1 = what I want my named range to refer to (TABLES!$C:$C, etc.)
TABLES row 2 = effective dates of when the columns should be used
Depending on the date that the user enters, I want to redefine my "MyDate"
Named Range to access different data.
I am using the WorksheetChange event so when the date field is modified, I
try to change "MyDate". I want "MyDate" to refer to a column on the TABLES
sheet (TABLES!$C:$C, for instance).
ActiveWorkbook.Names("MyDate").RefersTo =
Worksheets("TABLES").Range("$A$1").Offset(0,
Worksheets("Entry").Range("$A$2").Value).Value
When I go to the Name Manager after the previous command, MyDate shows in
the RefersTo column ="TABLES!$C:$C". However, using MyDate in an equation
doesn't work because MyDate is a text field. I need MyDate to refer to
=TABLES!$C:$C (no quotes). How can I accomplish this?
Two worksheets ("Entry" and "TABLES")
Entry!A1 = user-entered date
Entry!A2 = a Match formula to find which column to use on TABLES
(calculates to 2 for the date I have entered)
TABLES column A = my header column for all date entries
TABLES column B-F = entries which differ depending on date
TABLES row 1 = what I want my named range to refer to (TABLES!$C:$C, etc.)
TABLES row 2 = effective dates of when the columns should be used
Depending on the date that the user enters, I want to redefine my "MyDate"
Named Range to access different data.
I am using the WorksheetChange event so when the date field is modified, I
try to change "MyDate". I want "MyDate" to refer to a column on the TABLES
sheet (TABLES!$C:$C, for instance).
ActiveWorkbook.Names("MyDate").RefersTo =
Worksheets("TABLES").Range("$A$1").Offset(0,
Worksheets("Entry").Range("$A$2").Value).Value
When I go to the Name Manager after the previous command, MyDate shows in
the RefersTo column ="TABLES!$C:$C". However, using MyDate in an equation
doesn't work because MyDate is a text field. I need MyDate to refer to
=TABLES!$C:$C (no quotes). How can I accomplish this?