Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Macro cannot access hidden sheet

My macro works fine until I hide a sheet that it needs to use. The code stops
at the last line below:

Dim r As Range
Sheets("Main Page").Select
If IsError(Range("B3").Value) = False Then GoTo DoubleClick
Set r = Range("D5:M5")
Sheets("Part Numbers").Select
<

Unhiding the sheet (Part Numbers) clears up the problem, but I would prefer
to have it hidden.

What's the trick?

Thanks.

Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Macro cannot access hidden sheet

Hi,

You have choices.

1. Fleetingly unhide your sheet with code, do what you want and then re-hide
it.

2. Do what you need to do without selecting the sheet. For example this
works perfectly on a hidden sheet

Sheets("Sheet1").Range("A1").Value = 999

If you need help with the latter option we would need to see your code.

Mike

"MichaelRobert" wrote:

My macro works fine until I hide a sheet that it needs to use. The code stops
at the last line below:

Dim r As Range
Sheets("Main Page").Select
If IsError(Range("B3").Value) = False Then GoTo DoubleClick
Set r = Range("D5:M5")
Sheets("Part Numbers").Select
<

Unhiding the sheet (Part Numbers) clears up the problem, but I would prefer
to have it hidden.

What's the trick?

Thanks.

Mike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Macro cannot access hidden sheet

You can change application.screenupdating = false before you access it and
the user would never see a thing either. Set back to trued after you have
rehidden of course.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Mike H" wrote:

Hi,

You have choices.

1. Fleetingly unhide your sheet with code, do what you want and then re-hide
it.

2. Do what you need to do without selecting the sheet. For example this
works perfectly on a hidden sheet

Sheets("Sheet1").Range("A1").Value = 999

If you need help with the latter option we would need to see your code.

Mike

"MichaelRobert" wrote:

My macro works fine until I hide a sheet that it needs to use. The code stops
at the last line below:

Dim r As Range
Sheets("Main Page").Select
If IsError(Range("B3").Value) = False Then GoTo DoubleClick
Set r = Range("D5:M5")
Sheets("Part Numbers").Select
<

Unhiding the sheet (Part Numbers) clears up the problem, but I would prefer
to have it hidden.

What's the trick?

Thanks.

Mike

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to run on hidden sheet Tel Excel Discussion (Misc queries) 4 June 26th 09 09:08 PM
Refer to a hidden sheet using a macro. fullers Excel Programming 4 July 1st 08 06:58 AM
Using a Macro to look at Hidden Sheet alice Excel Discussion (Misc queries) 7 April 20th 07 09:16 AM
Macro for hidden sheet access Nigel Excel Programming 2 November 26th 05 04:19 PM
Macro dependent on hidden sheet? Cee_Pritchard Excel Programming 4 October 15th 04 01:29 PM


All times are GMT +1. The time now is 08:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"