Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I get Excel to check that the Active Cell is in a particular column
before executing a macro? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Kim,
If ActiveCell.Column = 1 Then 'your code here End If If you want it to do the macro each time the user selects a cell in a certain column use a worksheet SelectionChange event. Enter this in the code module for the worksheet (by right-clicking the worksheet tab and choosing "View Code"): Private Sub Worksheet_SelectionChange(ByVal Target As Range) If ActiveCell.Column = 1 Then 'your code here End If End Sub hth, Doug "KimR.Hammel" wrote in message ... How can I get Excel to check that the Active Cell is in a particular column before executing a macro? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Doug,
Thanks, I want it to check that the active cell is in, say, column CW. If yes, execute macro, else post a message box telling them where to select and exit on OK. Kim "Doug Glancy" wrote: Kim, If ActiveCell.Column = 1 Then 'your code here End If If you want it to do the macro each time the user selects a cell in a certain column use a worksheet SelectionChange event. Enter this in the code module for the worksheet (by right-clicking the worksheet tab and choosing "View Code"): Private Sub Worksheet_SelectionChange(ByVal Target As Range) If ActiveCell.Column = 1 Then 'your code here End If End Sub hth, Doug "KimR.Hammel" wrote in message ... How can I get Excel to check that the Active Cell is in a particular column before executing a macro? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I get row and column of active cell to highlight? | Excel Discussion (Misc queries) | |||
How to locate the Row and Column of an Active Cell | Excel Discussion (Misc queries) | |||
How to hide a column once any cell of that col. is not active any | Excel Programming | |||
Returning Column of active cell | Excel Programming | |||
copying the column of the active cell to another column | Excel Programming |