Jackson25
02-17-2010, 09:03 AM
Hi everybody,
I just wanna get some help about highlighting a row with a VBA code on excel if a cell of that row is selected. I got that code and that works but I don't want the entire row! For example, from A3 to AC3 and only in the rows 3 to 88. Wherever I click, the entire row is highlighted and even the highest row with my titles and the row underneath my tab change color as well. I just want A to AC and row 3 to 88. Is that possible with that formula to change something to get what I want... or I'm gonna need something else or that just impossible.
Thx for your help!
Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Static rr
Static cc
If cc <> "" Then
With Rows(rr).Interior
.ColorIndex = 50
End With
End If
r = Selection.Row
c = Selection.Column
rr = r
cc = c
With Rows(r).Interior
.ColorIndex = 20
.Pattern = xlSolid
End With
End Sub
I just wanna get some help about highlighting a row with a VBA code on excel if a cell of that row is selected. I got that code and that works but I don't want the entire row! For example, from A3 to AC3 and only in the rows 3 to 88. Wherever I click, the entire row is highlighted and even the highest row with my titles and the row underneath my tab change color as well. I just want A to AC and row 3 to 88. Is that possible with that formula to change something to get what I want... or I'm gonna need something else or that just impossible.
Thx for your help!
Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Static rr
Static cc
If cc <> "" Then
With Rows(rr).Interior
.ColorIndex = 50
End With
End If
r = Selection.Row
c = Selection.Column
rr = r
cc = c
With Rows(r).Interior
.ColorIndex = 20
.Pattern = xlSolid
End With
End Sub