Hidden sheets and macros

  • Thread starter Thread starter mwc0914
  • Start date Start date
M

mwc0914

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?
 
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
 
ActiveCell.Formula = "=+MyHiddenWorksheet!B2"

--
HTH,
Gary Brown
(e-mail address removed)
If this post was helpful to you, please select ''YES'' at the bottom of the
post.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top