View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Wuddus Wuddus is offline
external usenet poster
 
Posts: 24
Default Macro Error When Connecting to Hidden Sheet

Thanks, Dave. I think this will do the trick. Very helpful!

Sorry about the delayed response: I posted my question last night but then
didn't get a chance to log on until this morning.

"Dave Peterson" wrote:

Unhide the sheet first.

You could even hide what you're doing from the user:

Sub ToProjectInfoPage()
application.screenupdating = false
with Sheets("Project Info")
.visible = xlsheetvisible
.Select
.Range("A1:E1").Select
.visible = xlsheethidden
end with
application.screenupdating = true
End Sub

But there are not that many things that would require you to select a range.

Maybe you can just work on that range directly.



Wuddus wrote:

I have a very simple macro that, when run, takes the user to a specified
location on another sheet in the same workbook:

Sub ToProjectInfoPage()
Sheets("Project Info").Select
Range("A1:E1").Select
End Sub

This works fine when the destination sheet ("Project Info") is visible, but
when it's hidden, the macro returns an error.

Is there a way to fix the macro so that it works when the destination sheet
is hidden?

Thanks in advance!


--

Dave Peterson