Hideing and unhiding worksheets

  • Thread starter Thread starter 2007-User
  • Start date Start date
2

2007-User

Hi,

How can I hide and unhide worksheets base on a value of a cell which is in
another sheet.

Thanks in advance.
 
If worksheets("Sheet 1").cells(1,1).value = "Show Sheet" then
worksheets("Sheet 2").visible = true
else if worksheets("Sheet 1").cells(1,1).value = "Hide Sheet" then
worksheets("Sheet 2").visible = false
end if

wrote it on the fly but it should work.
 
Thanks John,

John Fuller said:
If worksheets("Sheet 1").cells(1,1).value = "Show Sheet" then
worksheets("Sheet 2").visible = true
else if worksheets("Sheet 1").cells(1,1).value = "Hide Sheet" then
worksheets("Sheet 2").visible = false
end if

wrote it on the fly but it should work.
 
or just cut the bottom off:

If worksheets("Sheet 1").cells(1,1).value = "Show Sheet" then
worksheets("Sheet 2").visible = true
else
worksheets("Sheet 2").visible = false
end if
 
Thanks,

LooneyTunes said:
or just cut the bottom off:

If worksheets("Sheet 1").cells(1,1).value = "Show Sheet" then
worksheets("Sheet 2").visible = true
else
worksheets("Sheet 2").visible = false
end if
 

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