Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro from cell specific to whole column | Excel Discussion (Misc queries) | |||
modify a macro to apply to a specific range of cells | Excel Discussion (Misc queries) | |||
lookup specific text, then apply rules | Excel Worksheet Functions | |||
How do I record a macro to move down and over to specific column | Excel Discussion (Misc queries) | |||
Apply Macro to Specific Column | Excel Programming |