• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Change Cell Number format based on a value

Dokat

Member
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

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:
Dokat

You have asked the same question in various disguises in 3 separate posts

Why not simply say

This is what I am trying to achieve ....

How can I best get that result?
 
Back
Top