Robin,
Do you get an error (and if so, what) or does nothing happen? There is no setting that would cause that that I can think of.
Rory
Main Topics
Browse All TopicsI just had a question answered by rorya - I was having a problem where files would not activate even if open, and the adding of the .xls file extension cured the problem as in Windows("newworkbookfordec
Now sheets will not activate
Sheets("Sheet1").Select
this must be a problem with the settings on this laptop as this code runs perfectly well every day on my pc.
A speedy reply would be much appreciated thanks, as I'm in an airport lounge!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thanks Saurabh, and for being so quick!
Ok I could do that, but there are many occurrences and several different workbooks each with different sheets - it's going to take me ages I think
Is it possible to address why exactly the same code is causing these problems on the laptop whilst it runs perfectly well on my pc. I have this idea that changing a setting somewhere will solve the problem?
Robin
Robin,
The method that i gave to you is safe a method and always work in all the PC's no matter what, The problem that i can think is that even when the workbook is activated, Your command is still trying to select sheet1 of the workbook from which you are running it so the only way to fix it is to declare the workbook for which it need tobe selected and like rory said there is no way to fix it, So you need to go this way to fix it.
Saurabh...
Robin,
If that code is in the ThisWorkbook module, then the Sheets collection defaults to that workbook, not the activeworkbook. If it is in a normal module, then it will default to the active workbook.
The error means that there is no Sheet1 in the workbook that is being assumed as the reference.
Rory
Business Accounts
Answer for Membership
by: saurabh726Posted on 2009-11-03 at 11:35:05ID: 25732605
Use this way...
Saurabh...
Select allOpen in new window