#1
|
|||
|
|||
How to Hide/Un-hide a worksheet based on cell on another sheet.
Hi All,
I am trying to hide a worksheet based on the result of another cell. So.... IF "supply" worksheet Cell E2 = 2 then I want "supply (2)" Worksheet to appear or become unhidden. Fist time posting so please let me know if there is anything wrong with this post. I've also tried a few different macros but couldn't get it working. Many Thanks! |
#2
|
|||
|
|||
Hi,
here are 2 simple macros to hide and unhide worksheets. You need to change the sheet names to that you want to Hide or Unhide name. Code:
Sub Hide_Worksheet() If ActiveSheet.Cells(2, 5).Text = "2" Then Sheets("Sheet2").Visible = False End If End Sub Code:
Sub UnHide_Worksheet() If ActiveSheet.Cells(2, 5).Text = "2" Then Sheets("Sheet2").Visible = True End If End Sub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA Code to Hide columns based on selection on prior sheet | Silver1379 | Excel Programming | 0 | 04-15-2015 08:40 AM |
Hide/Unhide Text Based on Drop Down Selection | gw1500se | Word | 3 | 02-19-2015 12:17 PM |
Show/Hide Text based on Checkbox Selection | tammytran105 | Word VBA | 7 | 10-02-2014 04:30 PM |
Show/hide paragraphs based on upfront decisions | miscia76 | Word | 1 | 11-13-2013 04:29 PM |
Hide Rows and Update Chart based on cell value | ubns | Excel Programming | 5 | 05-07-2012 05:44 AM |