VB question

M

mohavv

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
 
J

JP

You have to provide more context.

Is "Sht" a declared variable? If so, as what?
What is "a" ?


Thx,
JP
 
B

Bob Phillips

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)
 
Top