Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Refer to a hidden sheet using a macro.

I have written a macro that will move data into a sheet that is hidden.
However, when I run it I get the debugger message telling me it has failed.
If I unhide the sheet and run it then it works fine.

What is the best way round this?

Thanks in advance.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Refer to a hidden sheet using a macro.

just don't activate or try to select the hidden sheet

this copies data from sheet1 to sheet2 when sheet2 is hidden.

Range("A1").Copy Sheets("Sheet2").Range("D3")

edit the existing code and just reference the hidden sheet when you do your
copying.


--


Gary


"fullers" wrote in message
...
I have written a macro that will move data into a sheet that is hidden.
However, when I run it I get the debugger message telling me it has
failed.
If I unhide the sheet and run it then it works fine.

What is the best way round this?

Thanks in advance.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Refer to a hidden sheet using a macro.



"fullers" wrote:

I have written a macro that will move data into a sheet that is hidden.
However, when I run it I get the debugger message telling me it has failed.
If I unhide the sheet and run it then it works fine.

What is the best way round this?

If it is in a macro, run a code to unhide the sheet and then once the work
in this sheet hide it again. Substitute "hidden sheet" for your sheet

Dim UNHIDESHEET
Sheets("HiddenSheet").Visible = True

Dim HIDESHEET
Sheets("References").Visible = False

Cheers
Thanks in advance.

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
Assign Macro with Hidden Sheet Pran Excel Worksheet Functions 5 August 4th 09 01:32 PM
Macro to run on hidden sheet Tel Excel Discussion (Misc queries) 4 June 26th 09 09:08 PM
Using a Macro to look at Hidden Sheet alice Excel Discussion (Misc queries) 7 April 20th 07 09:16 AM
Can a macro format a hidden sheet? Robert Excel Discussion (Misc queries) 1 February 9th 05 06:13 PM
Refer to Hidden Sheet from VBA? Larry Adams Excel Programming 4 December 22nd 03 07:00 PM


All times are GMT +1. The time now is 01:22 AM.

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"