Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I am trying to write a marco that would mimick the "if then" statement in
excel. I have a workbook with several tabs, but depending on the info entered into the first tab only some of the proceeding sheets are populated (which is triggered from info placed in the first sheet). I want to create a button that can be clicked if the suer chooses, that will hide any non-needed sheets based on what the user enters into the first sheet, but I am clueless as how to write this in macro form. Any ideas??? Thanks! Bits of Colour |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Bits,
The basic statement would be: If Worksheets("Sheet1").Range("A1").Value = "Bits" Then Worksheets("Sheet2").Visible = True Else Worksheets("Sheet2").Visible = False End If The code above would show tab Sheet2 when cell A1 of Sheet1 was Bits, otherwise, it would hide it. You could build the macro from copies of this sub-set of statements. HTH, Bernie MS Excel MVP "BitsofColour" wrote in message ... I am trying to write a marco that would mimick the "if then" statement in excel. I have a workbook with several tabs, but depending on the info entered into the first tab only some of the proceeding sheets are populated (which is triggered from info placed in the first sheet). I want to create a button that can be clicked if the suer chooses, that will hide any non-needed sheets based on what the user enters into the first sheet, but I am clueless as how to write this in macro form. Any ideas??? Thanks! Bits of Colour |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro with F9 | Excel Discussion (Misc queries) | |||
writing macro | New Users to Excel | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) |