The following code will takeover the font colors of the names from the original list into my dropdownlist. 2 questions: how can i also do this with the background (fill) color? 2nd question: When i delete a name from the dropdown list an error occurs: 'Run-time error 91: Object variable or With block variable not set'
code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B2:B32")) Is Nothing Then Exit Sub
With Target.Font
.Color = Sheets("Maandoverzicht").Range("B8:B31").Find(Target).Font.Color
.Bold = Sheets("Maandoverzicht").Range("B8:B31").Find(Target).Font.Bold
End With
End Sub
Hope someone can help? thanks
code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B2:B32")) Is Nothing Then Exit Sub
With Target.Font
.Color = Sheets("Maandoverzicht").Range("B8:B31").Find(Target).Font.Color
.Bold = Sheets("Maandoverzicht").Range("B8:B31").Find(Target).Font.Bold
End With
End Sub
Hope someone can help? thanks