Not quite what I was looking for.....

U

Ultimate

When I pick a cell, I would like the whole row that the cell is in to
highlight. That is only as long as I have the cell picked. When I pick
another cell, I want that row to highlight. The highlight is only to
last as long as the cell in that row has been picked. Thanks in advance
for the help.
 
G

Gord Dibben

Ultimate

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Static OldCell As Range
If Not OldCell Is Nothing Then
With OldCell
.EntireRow.Interior.ColorIndex = xlColorIndexNone
End With
End If
Target.EntireRow.Interior.ColorIndex = 6 'yellow'
Set OldCell = Target
End Sub

Gord Dibben Excel MVP
 
F

Frank Kabel

Hi

after re-reading your post maybe the following code is what you want
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
Target.EntireRow.Select

CleanUp:
Application.EnableEvents = True
End Sub

Frank
 
U

Ultimate

I have seen some of these scripts and such but I don't know how to put
it in a module and have the module run when I open the workbook.
 
G

Gord Dibben

Ultimate

To use Frank's or my code, right-click on a sheet tab and select "View Code".

Copy/Paste the code into the module that opens.

This code will run only on that worksheet.

To use Chip's Rowliner add-in, unzip the file and stick the Rowliner.xla into
your Office\Library.

Load it through Tools>Add-ins. Checkmark at Rowliner.

Rowliner will work on all open worksheets.

Gord Dibben Excel MVP
 
U

Ultimate

It now does exactly what I want! Is there a way to change the color o
the highlight
 
U

Ultimate

I figured out how to change the colour using your code, Gord. thanks
again, I'll be back with more questions as I see other things I want in
the sheet where I record the cases I handle on a daily basis.
 
B

Biff

Just change the number value in the line:

Target.EntireRow.Interior.ColorIndex = 6 'yellow'

The 'yellow' is commented and is not part of the code.
It's just there to let you know that 6 = yellow.

Biff
 
Top