Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Apply Macro to Specific Column

Hi
you may post your existing macro.
But as an example try
...
dim rng as range
set rng = columns(3)
'or
'set rng = range("C:C")
for each c in rng
'....


--
Regards
Frank Kabel
Frankfurt, Germany


WintonCW wrote:
I have written a macro that highlights numbers in a given range (for
each c in <range)

However, I can't figure out how to set the range to only a specific
column
I have found the column number using a cells.find(), but how do I set
the range?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Apply Macro to Specific Column (Answered my own question)

Thanks -- this is the code that works::

Dim myCol As Long
Dim myCell As Range

Set myCell = Cells.Find("Code")

If Not myCell Is Nothing Then
myCol = myCell.Column
End If

For Each c In Columns(myCol).Cells
.....
Next c

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
Macro from cell specific to whole column Bean Counter[_2_] Excel Discussion (Misc queries) 4 May 27th 10 11:04 PM
modify a macro to apply to a specific range of cells Dave F Excel Discussion (Misc queries) 2 April 25th 07 03:00 AM
lookup specific text, then apply rules JAB Excel Worksheet Functions 0 June 27th 06 05:01 PM
How do I record a macro to move down and over to specific column VMH Excel Discussion (Misc queries) 2 March 13th 06 05:09 PM
Macro to search a column for a specific word and replace with wendy Excel Programming 5 January 19th 04 05:41 PM


All times are GMT +1. The time now is 11:38 PM.

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

About Us

"It's about Microsoft Excel"