Problem activating a sheet

  • Thread starter Thread starter jowatkins
  • Start date Start date
J

jowatkins

Hi,

I want to activate a sheet in Run time. Can anyone explain to me wh
of the following two bits of code, the first one work but the secon
doesn't.

Set monthSheet = baseBook.Sheets("Month")
monthSheet.Activate

Set currSheet = baseBook.Sheets(sheet)
currSheet.Activate - error message "Out of Range"

Cheers, J
 
Because you haven't enclosed sheet in quotes, so it is looking for a
variable called sheet, which is probably empty?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top