Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sheet number change | Excel Discussion (Misc queries) | |||
change page number in the same sheet | Excel Discussion (Misc queries) | |||
Best way to inser file property into and excel sheet (cell) | Excel Discussion (Misc queries) | |||
Change workbook sheet reference using cell A1 to change a vairable | Excel Worksheet Functions | |||
Can't change in-cell dropdown property of cell... | Excel Programming |