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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top