LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 3
Default Highlight Selected Range Only

Hi All,

Sorry if this is a bit of a muggle question, but i'm still getting my head round VBA.

I've got various macros at the moment that highlight certain things given a criteria, but so far i've only been able to highlight the entire row which is quite messy. The worksheet goes from column A - N and thats all i'd light highlighted. The code i've got so far is;

Sub HighlightRed()
Dim cell As Range

Range(Range("L7"), Range("L7").End(xlDown)).Select
For Each cell In Selection
If cell = "Red" Then cell.EntireRow.Interior.ColorIndex = 3
Next cell
End Sub

So it looks in Row L (starting from cell 7), and looks for any cells with "Red" in them, and highlights that entire row red. However I only want it to highlight cells in rows A to N, and not the "EntireRow".

Any help would be appreciated,

Thanks,
Ed
 
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
Highlight selected cells only RJJ Excel Worksheet Functions 4 May 5th 09 06:03 PM
Highlight selected area dkallen Excel Discussion (Misc queries) 4 September 12th 07 04:52 PM
How do I have a cell highlight when selected? Rhonda Excel Discussion (Misc queries) 0 October 2nd 06 05:12 PM
Trying to highlight (bold,red) selected text within range tmayhall Excel Discussion (Misc queries) 0 August 21st 06 10:03 PM
Highlight Row when selected cassy01 Excel Discussion (Misc queries) 2 September 6th 05 02:30 PM


All times are GMT +1. The time now is 12:07 AM.

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"