Below is some code that I have been using for some time. The way it is written is that it sends the cursor to column A each time the code is ran. What can be done so that when the code is ran that the cursor remains where it is?
Option Explicit
Dim Rng As Range
Sub HighlightYellow()
Range("A" & ActiveCell.Row).Select
Set Rng = ActiveCell.Range("A1:Z1")
With Rng.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Application.OnTime Now + TimeValue("00:00:10"), "RemoveHighlight"
End Sub
Sub RemoveHighlight()
With Rng.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
Option Explicit
Dim Rng As Range
Sub HighlightYellow()
Range("A" & ActiveCell.Row).Select
Set Rng = ActiveCell.Range("A1:Z1")
With Rng.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Application.OnTime Now + TimeValue("00:00:10"), "RemoveHighlight"
End Sub
Sub RemoveHighlight()
With Rng.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub