Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Building a Named Range in a formula with VBA
Results17 is the named range I am trying to "build" in my Vlookup.
------------ Dim week As Integer week = InputBox("Enter the Week", Week) ' I type in 17 Range("B2").Formula = "=VLookup(A2, ""Results"" & week, 2, False)" ------------- I get the Invalid Name error. If I remove the double-double quotes around ""Results"", I get a compile error. Please help Thanks John |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Building a Named Range in a formula with VBA
John,
Try this Range("B2").Formula = "=VLookup(A2, Results" & week & ", 2, False)" -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "John" wrote in message ... Results17 is the named range I am trying to "build" in my Vlookup. ------------ Dim week As Integer week = InputBox("Enter the Week", Week) ' I type in 17 Range("B2").Formula = "=VLookup(A2, ""Results"" & week, 2, False)" ------------- I get the Invalid Name error. If I remove the double-double quotes around ""Results"", I get a compile error. Please help Thanks John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
building formulas that change frequently using named cell ranges | Excel Worksheet Functions | |||
Array as a "named range" - formula ok in cells, but error as "named range" | Excel Discussion (Misc queries) | |||
Formula for named range | Excel Discussion (Misc queries) | |||
named range into formula? | Excel Worksheet Functions | |||
dynamically building references to named ranges | Excel Discussion (Misc queries) |