View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.misc
RobN[_2_] RobN[_2_] is offline
external usenet poster
 
Posts: 230
Default Selecting sheet with VB

Thanks to all who contributed. I don't think my problem was fully
understood, but I think I've managed to compile a solution from using bits
from all the answers.

Rob

"Bob Phillips" wrote in message
...
sorry, I meant

Dim ss As Variant
Set ss = Sheet60
ss.Select
ss..Range("d2").select

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"RobN" wrote in message
...
Bob,

I tried the following without success.
Dim ss As Variant
Set ss = Sheet60.Range("d2")
ss.Select

error: Select method of range class failed.

Rob



"Bob Phillips" wrote in message
...
ss.Select

but you rarely need to select the sheet, just use the ss variable.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"RobN" wrote in message
...
(I posted this in the office.misc newsgroup by mistake)

I've used the following to try and have VB select a sheet dependant on
the
value in d2.
Dim ss As Variant
Set ss = Sheet60.Range("d2")

How do I apply that now to select that sheet? I thought something like
sheet(ss).select would do it, but it doesn't work

Sheets(ss).select does work, but doesn't go to the correct sheet
number,
whereas Sheet(ss) brings up a "Sub or Function not defined" error.

Rob