Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
active a set of VBA code once the cell have data.
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
active a set of VBA code once the cell have data.
SelectionChange is triggered when you select the cell, whereas change i triggered when you change or enter something in a cell. I guess in you case, change would be better. Manges -- mangesh_yada ----------------------------------------------------------------------- mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047 View this thread: http://www.excelforum.com/showthread.php?threadid=38000 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Row select mode to highlight active row of active cell | Excel Discussion (Misc queries) | |||
Creating an active timeline of data from cell input | Excel Worksheet Functions | |||
How to Add Rows From Active Cell with in a XLL Code | Excel Worksheet Functions | |||
Ho do I determine the Active Cell location of the data being sele. | Excel Programming | |||
Load active cell data via a function | Excel Worksheet Functions |