Have a macro that reformats a newly opened workbook. (Items such as deleting columns, and inserting formulas in a couple of fields.)
Would like to have the aformentioned macro (which is located in another workbook), add this event handler private sub below in addition to reformatting the page as described. It adds a highlight row.
The code I'd like to add is this:
Thanks in advance for some direction on this.![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Cells.FormatConditions.Delete With Target.EntireRow .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE" With .FormatConditions(1) With .Borders(xlTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 2 End With With .Borders(xlBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 8 End With End With .FormatConditions(1).Interior.ColorIndex = 42 End With End Sub
Petee
Bookmarks