I'm using the folowing code in a workbook that converts Range("A1:T1") to highlight that range with bright yellow.
Option Explicit
Dim Rng As Range
Sub HighlightYellow()
Range("A" & ActiveCell.Row).Select
Set Rng = ActiveCell.Range("A1:T1")
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
I would like to use this in the same book with other column lengths, some more columns, some less. Is it possble to have it find the last columne rather than hard copy a specified column. As well, rather than have the cursor return to Column "A" is is posibble to have the cursor remain where it was a the time it started the highlighting. And one last question, is it possible to shutoff the macro to go and hightlight another row?
Thanks,
Option Explicit
Dim Rng As Range
Sub HighlightYellow()
Range("A" & ActiveCell.Row).Select
Set Rng = ActiveCell.Range("A1:T1")
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
I would like to use this in the same book with other column lengths, some more columns, some less. Is it possble to have it find the last columne rather than hard copy a specified column. As well, rather than have the cursor return to Column "A" is is posibble to have the cursor remain where it was a the time it started the highlighting. And one last question, is it possible to shutoff the macro to go and hightlight another row?
Thanks,