I have this simple code that is acting in the background to check if the data validation list selection in Cell AB19 is "User Defined". It all basically formatting changes.
Now this macro is only acting on Cell AB19 where this data validation list is. But I have 10 more different rows each having its own data validation list that will follow the same check.
I am trying to transform this macro to act not only on Cell AB19 but also to act on the 10 other data validation lists on Rows 20 to Row 30 (AB20, AB21, AB22 etc.). I don't want to repeat this macro 10 times to check for each data validation.
Is there a tidier way to adjust this macro. Or maybe any other suggested code.
Any help is appreciated.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) If Range("AB19").Value = "User Defined" Then Range("AG19:AM19").Select With Selection.Font .ThemeColor = xlThemeColorDark1 End With Range("AN19:AO19").Select With Selection.Interior .Color = 14803455 End With Selection.Locked = False Else Range("AG19:AM19").Select With Selection.Font .ThemeColor = xlThemeColorLight1 End With Range("AN19:AO19").Select With Selection.Interior .Pattern = xlNone End With Selection.Locked = True End If End Sub