WenlockExcel
New Member
- Joined
- Aug 29, 2011
- Messages
- 2
I already have a workin macro that performs the activity I want done - which is to some fields to specified values and to then clear values in a series of others. However, I now I want to add an If Then Else statement to macro that will only allow the macro to operate if a specified condition is true. So ---
Cell AG1 can equal "Go" or "No Go". and I want the macro to works as follows
IF SAG1 = "Go"
Then
Range("O2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "0"
Range("M2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Selection.AutoFill Destination:=Range("C2:C716"), Type:=xlFillDefault
Range("C2:C716").Select
ActiveWindow.ScrollRow = 1
Range("D1").Select
Selection.ClearContents
End Sub
ElseIf AG1 = "No Go"
End Sub
Any advice on how I shoudl do this please?
Cell AG1 can equal "Go" or "No Go". and I want the macro to works as follows
IF SAG1 = "Go"
Then
Range("O2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "0"
Range("M2").Select
ActiveCell.FormulaR1C1 = "0"
Range("C2").Select
ActiveCell.FormulaR1C1 = "0"
Selection.AutoFill Destination:=Range("C2:C716"), Type:=xlFillDefault
Range("C2:C716").Select
ActiveWindow.ScrollRow = 1
Range("D1").Select
Selection.ClearContents
End Sub
ElseIf AG1 = "No Go"
End Sub
Any advice on how I shoudl do this please?