PCha0s
07-10-2018, 03:42 PM
I try to highlight a row on acive cell, but need some help
I need col F to AS and row 3 to 500 highlight only! :think:
I tried this VBA code:
Const maxoszlop As Long = 45
Const vilagit As Long = 8
Static rOld As Range
Static nColorIndices(1 To maxoszlop) As Long
Dim i As Long
If Not rOld Is Nothing Then
With rOld.Cells
If .Row = ActiveCell.Row Then Exit Sub
For i = 1 To maxoszlop
.Item(i).Interior.ColorIndex = nColorIndices(i)
Next i
End With
End If
Set rOld = Cells(ActiveCell.Row, 1).Resize(1, maxoszlop)
With rOld
For i = 1 To maxoszlop
nColorIndices(i) = .Item(i).Interior.ColorIndex
Next i
.Interior.ColorIndex = vilagit
End With
Thanks!
I need col F to AS and row 3 to 500 highlight only! :think:
I tried this VBA code:
Const maxoszlop As Long = 45
Const vilagit As Long = 8
Static rOld As Range
Static nColorIndices(1 To maxoszlop) As Long
Dim i As Long
If Not rOld Is Nothing Then
With rOld.Cells
If .Row = ActiveCell.Row Then Exit Sub
For i = 1 To maxoszlop
.Item(i).Interior.ColorIndex = nColorIndices(i)
Next i
End With
End If
Set rOld = Cells(ActiveCell.Row, 1).Resize(1, maxoszlop)
With rOld
For i = 1 To maxoszlop
nColorIndices(i) = .Item(i).Interior.ColorIndex
Next i
.Interior.ColorIndex = vilagit
End With
Thanks!