LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Highlight Cells

I would like to highlight a line of cells when the cell is selected. I tried
the following code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rng As Range
Dim ycell As Range

Set ycell = ActiveCell.EntireRow.Cells(3)
Set rng = Range(ycell, ycell.Offset(0, 5))
rng.Interior.ColorIndex = 36

End Sub

but I get an error that says 'Unable to set ColorIndex property of the
interior class'.
What am I doing wrong here? or is there a better way to do this?
Thanks
 
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 to highlight more related cells if cell highlight Jon Excel Discussion (Misc queries) 5 December 21st 08 01:06 PM
How to highlight cells... Mare Excel Discussion (Misc queries) 3 January 28th 06 01:09 PM
Highlight Cells EMoe[_74_] Excel Programming 6 November 9th 05 06:26 PM
Highlight cells with ctrl-click but only un-highlight one cell hagan Excel Discussion (Misc queries) 5 May 27th 05 06:45 PM
Highlight all cells, except top row? Reedi Excel Programming 1 October 3rd 03 10:03 PM


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