Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
NOT ABLE TO ENTER VB CODE
I am not able to enter this " Private Sub Worksheet_Change(ByVal Target As
Range" more than once in the sheet code of any particular code. Once I am entering any macro starting with this it says ambiguos code, I am new to VB kindly help me out. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
NOT ABLE TO ENTER VB CODE
Hi,
What you are entering is called event code and the event Private Sub Worksheet_Change... is executed whenver the worksheet changes but you can only have one module with this name. You could try something like this Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" Then 'do something End If If Target.Address = "$B$1" Then 'do something else End If End Sub Mike "SANDIND" wrote: I am not able to enter this " Private Sub Worksheet_Change(ByVal Target As Range" more than once in the sheet code of any particular code. Once I am entering any macro starting with this it says ambiguos code, I am new to VB kindly help me out. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
can someone help me with code for tab/enter stops? | Excel Programming | |||
code to enter in returns | Excel Programming | |||
ALT + enter or Char(13) in code | Excel Discussion (Misc queries) | |||
Enter VBA Code Password | Excel Programming | |||
Code equivalent to the Enter-Key | Excel Programming |