View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default active a set of VBA code once the cell have data.

Change event. Here is an outline of your code

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:C12")) Is Nothing Then
With Target
'do your stuff
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
HTH

Bob Phillips

"norika" wrote in message
...
Dear all,

I am now setting up a simple label template for the junior, and already

made
a drop down list through validation function within the range A1:C12.

Once if the user type something in the cell within the range , I want to
execute some VBA coding such as formatting , coping .....etc.

Where should I start to create the coding ? In
Worksheet_SelectionChange(ByVal Target As Range), or

Worksheet_Change(ByVal
Target As Range)


Thanks all.