Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
VB question
Hi,
Why do I get an error: Sht = Sheets("print").Range("D" & a).Value Sheets(Sht).Range("Print_Area" & Sht).Select but when I cut it in 2 it works: Sht = Sheets("print").Range("D" & a).Value Sheets(Sht).Select Range("Print_Area" & Sht).Select Cheers, Harold |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
VB question
You have to provide more context.
Is "Sht" a declared variable? If so, as what? What is "a" ? Thx, JP On Dec 13, 3:53 pm, mohavv wrote: Hi, Why do I get an error: Sht = Sheets("print").Range("D" & a).Value Sheets(Sht).Range("Print_Area" & Sht).Select but when I cut it in 2 it works: Sht = Sheets("print").Range("D" & a).Value Sheets(Sht).Select Range("Print_Area" & Sht).Select Cheers, Harold |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
VB question
Because you have to activate a sheet before you can select a range on that
sheet. But you shouldn't need to select anything. What are you trying to do? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "mohavv" wrote in message ... Hi, Why do I get an error: Sht = Sheets("print").Range("D" & a).Value Sheets(Sht).Range("Print_Area" & Sht).Select but when I cut it in 2 it works: Sht = Sheets("print").Range("D" & a).Value Sheets(Sht).Select Range("Print_Area" & Sht).Select Cheers, Harold |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sum if question | Excel Worksheet Functions | |||
Look up question | Excel Worksheet Functions | |||
Newbie Question - Subtraction Formula Question | Excel Discussion (Misc queries) | |||
The question is an excel question that I need to figure out howto do in excel. | Excel Worksheet Functions | |||
VBA Question | Excel Discussion (Misc queries) |