Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default check active cell column

How can I get Excel to check that the Active Cell is in a particular column
before executing a macro?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default check active cell column

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default check active cell column

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get row and column of active cell to highlight? chappi Excel Discussion (Misc queries) 2 August 19th 09 10:21 PM
How to locate the Row and Column of an Active Cell Fred Excel Discussion (Misc queries) 1 December 7th 05 05:55 PM
How to hide a column once any cell of that col. is not active any Frederic Excel Programming 1 May 25th 05 02:21 PM
Returning Column of active cell Marek Excel Programming 1 April 29th 05 02:13 PM
copying the column of the active cell to another column Paul James[_5_] Excel Programming 2 February 26th 04 08:04 PM


All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"