ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hidden sheets and macros (https://www.excelbanter.com/excel-programming/366301-hidden-sheets-macros.html)

mwc0914[_18_]

Hidden sheets and macros
 

I have a macro that references some data on a sheet I wish to have
hidden in my workbook. The macro abends because the sheet is hidden. Is
there some way to reference the hidden sheet in the macro so it will
execute?


--
mwc0914
------------------------------------------------------------------------
mwc0914's Profile: http://www.excelforum.com/member.php...o&userid=24130
View this thread: http://www.excelforum.com/showthread...hreadid=558479


colofnature[_61_]

Hidden sheets and macros
 

A simple solution would be to make the sheet visible during execution of
the macro then hide it again at the end. Put this at the start of your
code:

application.screenupdating = false
sheets("TheHiddenSheet").visible = true

and this at the end:

sheets("TheHiddenSheet").visible = false
application.screenupdating = true

That way the sheet will be available to the rest of your macro, but the
user won't see it appear and disappear.

Col


--
colofnature
------------------------------------------------------------------------
colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356
View this thread: http://www.excelforum.com/showthread...hreadid=558479


Gary Brown

Hidden sheets and macros
 
ActiveCell.Formula = "=+MyHiddenWorksheet!B2"

--
HTH,
Gary Brown

If this post was helpful to you, please select ''YES'' at the bottom of the
post.



"mwc0914" wrote:


I have a macro that references some data on a sheet I wish to have
hidden in my workbook. The macro abends because the sheet is hidden. Is
there some way to reference the hidden sheet in the macro so it will
execute?


--
mwc0914
------------------------------------------------------------------------
mwc0914's Profile:
http://www.excelforum.com/member.php...o&userid=24130
View this thread: http://www.excelforum.com/showthread...hreadid=558479




All times are GMT +1. The time now is 02:15 AM.

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