+ Reply to Thread
Results 1 to 3 of 3

Change number property for cell on another sheet

  1. #1
    Qaspec
    Guest

    Change number property for cell on another sheet

    I'd like the number format for the value in cells D1:D30 on sheet2("daily")
    to be a general number if a1("data") is empty and i'd like the format to be a
    percentage if a1("data") contains a value. This is similiar to a previous
    post but this tim the cells are on different sheets.



  2. #2
    Tom Ogilvy
    Guest

    Re: Change number property for cell on another sheet

    Put the code in the Data sheet code module


    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    set sh = Worksheets("Daily")
    With Target(1)
    If .Address(False, False) = "A1" Then
    If IsEmpty(.Value) Then
    sh.Range("A3").NumberFormat = "General"
    Else
    sh.Range("A3").NumberFormat = "0%"
    End If
    End If
    End With
    End Sub

    --
    Regards,
    Tom Ogilvy


    "Qaspec" <[email protected]> wrote in message
    news:[email protected]...
    > I'd like the number format for the value in cells D1:D30 on

    sheet2("daily")
    > to be a general number if a1("data") is empty and i'd like the format to

    be a
    > percentage if a1("data") contains a value. This is similiar to a previous
    > post but this tim the cells are on different sheets.
    >
    >




  3. #3
    Bob Phillips
    Guest

    Re: Change number property for cell on another sheet

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    With Target(1)
    If .Address(False, False) = "A1" Then
    If IsEmpty(.Value) Then
    Worksheets("daily").Range("D1:D30").NumberFormat =
    "General"
    Else
    Worksheets("daily").Range("D1:D30").NumberFormat = "0%"
    End If
    End If
    End With
    End Sub



    --
    HTH

    Bob Phillips

    "Qaspec" <[email protected]> wrote in message
    news:[email protected]...
    > I'd like the number format for the value in cells D1:D30 on

    sheet2("daily")
    > to be a general number if a1("data") is empty and i'd like the format to

    be a
    > percentage if a1("data") contains a value. This is similiar to a previous
    > post but this tim the cells are on different sheets.
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1