Hi,
I have below code that should change the formatting in cell range D4:D11 basedon the value on cell D1. However it is not working. Can you please let me know what i am doing wrong? Thanks
Thanks
I have below code that should change the formatting in cell range D4:D11 basedon the value on cell D1. However it is not working. Can you please let me know what i am doing wrong? Thanks
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Set ws = Worksheets("Source Data")
Set Target = ws.Range("BD1").Value
If Target = "1" Then
ws.Range("BD4:BD11").NumberFormat = "$0.0,,"
ElseIf Target = "2" Then
ws.Range("BD4:BD11").NumberFormat = "0.0%"
End If
End Sub
Thanks
Last edited: