hello,
i am using this code to call macros based on cell value.
Only problem i am having is whenever any other work i do on the sheet the macro triggers.
Whereas i only want the macros to triger when the value of cell A1 changes. Like when i enter anything
in cell (lets say) b2 and as soon as i press enter the macro triggers
Secondly cell A1 has a data validation list. i want to call the macro (sixpo) when the cell is blank.
i dont know how to enter it in the above code.
i would be grateful if anyone can help.
Thanks
Humayun
i am using this code to call macros based on cell value.
Code:
Sub worksheet_change(ByVal target As Range)
Set target = Range("A1")
If target.Value = "1" Then
Call onepo
End If
If target.Value = "2" Then
Call twopo
End If
If target.Value = "3" Then
Call threepo
End If
If target.Value = "4" Then
Call fourpo
End If
If target.Value = "5" Then
Call fivepo
End If
If target.Value = "6" Then
Call sixpo
End If
End Sub
Only problem i am having is whenever any other work i do on the sheet the macro triggers.
Whereas i only want the macros to triger when the value of cell A1 changes. Like when i enter anything
in cell (lets say) b2 and as soon as i press enter the macro triggers
Secondly cell A1 has a data validation list. i want to call the macro (sixpo) when the cell is blank.
i dont know how to enter it in the above code.
i would be grateful if anyone can help.
Thanks
Humayun
Last edited: