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

WintonCW

You can use the EntireColumn property, but you may want to limit that a
little. Try something like this

Dim FndRng As Range

Set FndRng = ...cells.Find(...)

If Not FndRng Is Nothing Then
For Each Cell In
Intersect(FndRng.EntireColumn,FndRng.Parent.UsedRa nge).Cells
'Do stuff
Next Cell
End If

FndRng will be the cell that you 'found' and the EntireColumn property will
return the whole column. The Intersect method is used so that you don't go
through 65000 cells, just what's used in the spreadsheet.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"WintonCW" wrote in message
...
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?


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
Apply Macro to Specific Column Frank Kabel Excel Programming 1 May 12th 04 08:46 PM


All times are GMT +1. The time now is 10:07 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"