Macro dependent on hidden sheet?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've written a Macro which returns information held in a sheet I now want to
hide (I dont want anyone messing about with the data!)

But when I hide the sheet the macro can no longer find the information and
says there is a runtime error!

Any ideas how I can get it to look up the information from this hidden sheet?

Cheers
 
I can read data from a hidden sheet, so it must be something else.

Show us the full code.
 
It should work. For example this works fine!

Dim SH As Worksheet

Set SH = ActiveSheet

SH.Visible = xlSheetVeryHidden

Debug.Print SH.Range("A1")

SH.Visible = xlSheetVisible


or is it another way you do it?
 
Yeah Oddly enough I tried it again after changing some ".Select" commands to
".activate" and it's working perfectly now!!!

Thanks for replying tho!
 
assume the hidden sheet name is "ABCD"

then

set rng = Worksheets("ABCD").Range("A1").Value
msgbox rng.Address(external:=True) & " - value: " & rng.Value


Worksheets("ABCD").Activate
Range("A1").Select
msgbox Selection.Value

won't work.
 

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