trebor1956
Board Regular
- Joined
- Jul 2, 2015
- Messages
- 100
- Office Version
- 2013
- Platform
- Windows
Hi,
I use the following code to highlight he active cell and it works fine, but when I save the workbook the last cell selected stays wit the highlighted colour. On save I would like to select say cell A1 and clear the fill colour.
Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
'Update 20140923
Static xLastRng As Range
On Error Resume Next
Target.Interior.ColorIndex = 8
xLastRng.Interior.ColorIndex = xlColorIndexNone
Set xLastRng = Target
End Sub
Hope you can help.....
I use the following code to highlight he active cell and it works fine, but when I save the workbook the last cell selected stays wit the highlighted colour. On save I would like to select say cell A1 and clear the fill colour.
Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
'Update 20140923
Static xLastRng As Range
On Error Resume Next
Target.Interior.ColorIndex = 8
xLastRng.Interior.ColorIndex = xlColorIndexNone
Set xLastRng = Target
End Sub
Hope you can help.....