Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how do i get a code to run when i change the value in a cell?
cell a1 is blank, i enter 1 "codeone" runs, i enter 2 "codetwo" runs thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following code, placed in the Worksheet Module - (right-click the sheet
tab and select View Code) should start you off. If the the cell changed is A1 (row 1, column 1) it calls subs depending on the value entered. 1 - CodeOne etc. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row = 1 And Target.Column = 1 Then Select Case Target.Value Case 1 CodeOne Case 2 CodeTwo Case 3 CodeThree End Select End If End Sub regards, Don "choice" wrote in message ... how do i get a code to run when i change the value in a cell? cell a1 is blank, i enter 1 "codeone" runs, i enter 2 "codetwo" runs thanks in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
not working for some reason, im not sure if i understand the Cases that well
in EP3 i have a drop down list..values are (Utilities, Paychecks, Other) if Utilities is selected application.run "code1" if Paychecks is selected application.run "code2" if Other is selected application.run "code3" so do i put case "Utilities": application.run "code1" ? "Don Lloyd" wrote: The following code, placed in the Worksheet Module - (right-click the sheet tab and select View Code) should start you off. If the the cell changed is A1 (row 1, column 1) it calls subs depending on the value entered. 1 - CodeOne etc. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row = 1 And Target.Column = 1 Then Select Case Target.Value Case 1 CodeOne Case 2 CodeTwo Case 3 CodeThree End Select End If End Sub regards, Don "choice" wrote in message ... how do i get a code to run when i change the value in a cell? cell a1 is blank, i enter 1 "codeone" runs, i enter 2 "codetwo" runs thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|