Snake Eyes
Board Regular
- Joined
- Dec 14, 2010
- Messages
- 103
- Office Version
- 365
- 2016
- Platform
- Windows
Greetings,
I've applied the code below to two (2) sheets in the same workbook. These two worksheets are identically configured when it comes to columns, formatting and macros. The only difference is the data/values in the rows/cells.
The code highlights a row by bolding and underlining text when the row is selected. The code works in Sheet1 but not in Sheet2.
Can someone help me understand why this is?
Here is the formatting for the first sheet that works...
Here it is for the 2nd sheet that does not work...
I've applied the code below to two (2) sheets in the same workbook. These two worksheets are identically configured when it comes to columns, formatting and macros. The only difference is the data/values in the rows/cells.
The code highlights a row by bolding and underlining text when the row is selected. The code works in Sheet1 but not in Sheet2.
Can someone help me understand why this is?
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' Sets the selected row text to bold and underline
With ThisWorkbook.Names("HighlightRow")
.Name = "HighlightRow"
.RefersToR1C1 = "=" & ActiveCell.Row
End With
End Sub
Here is the formatting for the first sheet that works...
Here it is for the 2nd sheet that does not work...
Attachments
Last edited: