ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Refer to a hidden sheet using a macro. (https://www.excelbanter.com/excel-programming/344610-refer-hidden-sheet-using-macro.html)

fullers

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.

Tushar Mehta

Refer to a hidden sheet using a macro.
 
In article ,
says...
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.

What is the code that moves the data? My guess is you are activating or
selecting something on the hidden sheet.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Multi-disciplinary business expertise
+ Technology skills
= Optimal solution to your business problem
Recipient Microsoft MVP award 2000-2005

Gary Keramidas

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.




Johno

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.


Nigel[_2_]

Refer to a hidden sheet using a macro.
 
You can write to a hidden sheet, but I suspect your code has activates or
selections in it which will fail if the sheet is hidden.

Post your code for someone to show you how to remove these.

--

Regards,
Nigel




"Johno" wrote in message
...


"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.




All times are GMT +1. The time now is 09:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com