nbooth
01-27-2012, 02:45 PM
Hi -
I'm working on a project and would like to make the following code active with a trigger cell - like an "if" statement in Excel: if($D$3=0, activate code, don't activate code).
I've run a macro recorder and tweaked the code a bit to get the macro to do most of what I want. All I need to do now is make the code key off D3 on the Assumptions tab...And to turn off, or revert back to normal, when D3=1. Here's the recorder code:
Sub Macro3()
'
' Macro3 Macro
'
' Keyboard Shortcut: Ctrl+n
'
ActiveWindow.Zoom = 100
Columns("AD:BC").Select
Range("AD4").Activate
Selection.EntireColumn.Hidden = True
Sheets("Utility Comparison").Select
ActiveWindow.Zoom = 100
Rows("1:9").Select
Selection.EntireRow.Hidden = True
Sheets("Income Statement & Tax").Select
ActiveWindow.Zoom = 100
Rows("1:13").Select
Selection.EntireRow.Hidden = True
Sheets("Tax Rate Chart").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Depreciation").Select
ActiveWindow.Zoom = 100
Rows("2:16").Select
Selection.EntireRow.Hidden = True
Sheets("Construction").Select
ActiveWindow.Zoom = 100
Rows("2:9").Select
Selection.EntireRow.Hidden = True
Sheets("Debt").Select
ActiveWindow.Zoom = 100
Columns("U:AB").Select
Columns("U:AH").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.Zoom = 100
Rows("1:13").Select
Selection.EntireRow.Hidden = True
Sheets("Cap&IRRs").Select
ActiveWindow.SelectedSheets.Visible = False
ActiveWindow.Zoom = 100
End Sub
Any help would be greatly appreciated.
Thanks!
nbooth
I'm working on a project and would like to make the following code active with a trigger cell - like an "if" statement in Excel: if($D$3=0, activate code, don't activate code).
I've run a macro recorder and tweaked the code a bit to get the macro to do most of what I want. All I need to do now is make the code key off D3 on the Assumptions tab...And to turn off, or revert back to normal, when D3=1. Here's the recorder code:
Sub Macro3()
'
' Macro3 Macro
'
' Keyboard Shortcut: Ctrl+n
'
ActiveWindow.Zoom = 100
Columns("AD:BC").Select
Range("AD4").Activate
Selection.EntireColumn.Hidden = True
Sheets("Utility Comparison").Select
ActiveWindow.Zoom = 100
Rows("1:9").Select
Selection.EntireRow.Hidden = True
Sheets("Income Statement & Tax").Select
ActiveWindow.Zoom = 100
Rows("1:13").Select
Selection.EntireRow.Hidden = True
Sheets("Tax Rate Chart").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Depreciation").Select
ActiveWindow.Zoom = 100
Rows("2:16").Select
Selection.EntireRow.Hidden = True
Sheets("Construction").Select
ActiveWindow.Zoom = 100
Rows("2:9").Select
Selection.EntireRow.Hidden = True
Sheets("Debt").Select
ActiveWindow.Zoom = 100
Columns("U:AB").Select
Columns("U:AH").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.Zoom = 100
Rows("1:13").Select
Selection.EntireRow.Hidden = True
Sheets("Cap&IRRs").Select
ActiveWindow.SelectedSheets.Visible = False
ActiveWindow.Zoom = 100
End Sub
Any help would be greatly appreciated.
Thanks!
nbooth