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: 336
Default Active Cell

Hello,

I have soem code that doesnt quite work properly and was hoping for some
guidance.

I want to colour the first column of the selected row black, so it
highlights to the user which row they are in. Then when the user moves to
another row the first column of the previous cell reverst back to no colour.
Here is the code so far:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim lRow As Long

For lRow = 34 To 100
If lRow = ActiveCell.Row Then
Cells(Target.Row, 1).Interior.ColorIndex = 1
Else
Cells(Target.Row, 1).Interior.ColorIndex = xlNone
End If

Next

End Sub

I think the problem is with the line:

If lRow = ActiveCell.Row Then

Can anyone help me?

Thanks in advance.

Martin
 
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
Row select mode to highlight active row of active cell Bart Fay[_2_] Excel Discussion (Misc queries) 0 May 11th 10 09:34 PM
run macro although blinking cursor is active in an active cell bartman1980 Excel Programming 1 December 20th 07 11:29 AM
referring to formula in a non active cell from active cell nickname Excel Discussion (Misc queries) 1 June 21st 07 12:11 PM
I need to sort an active sheet using the col of the active cell HamFlyer Excel Programming 3 June 6th 06 07:25 PM
Copy from active sheet and paste into new sheet using info from cell in active Ingve Excel Programming 3 January 23rd 06 09:57 PM


All times are GMT +1. The time now is 03:25 PM.

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"