Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't switch between worksheets

Status
Not open for further replies.

rnuage

MIS
May 6, 2003
3
US
I'm trying to go back and forth between worksheets on a MAC (I normally work with a pc) and for some reason I can only switch once. The following code

Worksheets("Sheet2").Activate
Worksheets("Sheet1").Activate

works fine on the first statement and fails on the second with "Application or User defined Error."

I've tried using indexes instead of names, tried Sheets instead of Worksheets... I'm stuck. Any idea what this problem could be?
 
This is what I use without any problems. I'm a rookie at this stuff though:

Set xlWorksheet = Excel.Sheets(6) 'or whatever number
xlWorksheet.Activate

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top