balaji3081
Member
Hi All,
I am trying to get a two rows formatted based on the value in the range, my code has a event worksheet_change which is disabling my excel undo function, I am not at all comfortable with this, is there a better code to give me the result -
Below is the code I am currently using -
I am trying to get a two rows formatted based on the value in the range, my code has a event worksheet_change which is disabling my excel undo function, I am not at all comfortable with this, is there a better code to give me the result -
Below is the code I am currently using -
Code:
Sub Worksheet_Change(ByVal Target As Range)
Range("h40:aa63").Font.Bold = False
Range("h40:aa63").Font.Underline = False
Dim row1 As Integer
Set MyPlage = Range("h40:h63")
For Each cell In MyPlage
Select Case cell.Value
Case Is = "Core"
cell.Font.Bold = True
row1 = cell.Row - 1
Sheets("LIE").Range("i" & row1 & ":aa" & row1).Font.Underline = True
Case Is = "Customer Assistance"
cell.Font.Bold = True
row1 = cell.Row - 1
Sheets("LIE").Range("i" & row1 & ":aa" & row1).Font.Underline = True
Case Is = "Default "
cell.Font.Bold = True
row1 = cell.Row - 1
Sheets("LIE").Range("i" & row1 & ":aa" & row1).Font.Underline = True
Case Is = "Support"
cell.Font.Bold = True
row1 = cell.Row - 1
Sheets("LIE").Range("i" & row1 & ":aa" & row1).Font.Underline = True
Case Is = "Mortgage Servicing"
cell.Font.Bold = True
cell.Interior.ColorIndex = 6
row1 = cell.Row - 1
Sheets("LIE").Range("i" & row1 & ":aa" & row1).Font.Underline = True
Case Is = "Other"
cell.Font.Bold = True
row1 = cell.Row - 1
Sheets("LIE").Range("i" & row1 & ":aa" & row1).Font.Underline = True
'Case Is = "Default"
'cell.Font.Bold = True
'row1 = cell.Row - 1
'Sheets("Sheet1").Range("C" & row1 & ": J" & row1).Font.Underline = True
'Case Is = "P"
'cell.EntireRow.Interior.ColorIndex = 6
End Select
Next
End Sub
Last edited: