View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Problem activating a sheet

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)

"jowatkins " wrote in message
...
Hi,

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

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

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

Cheers, Jo


---
Message posted from http://www.ExcelForum.com/