Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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" 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sheet number change Bill5001210 Excel Discussion (Misc queries) 0 March 12th 07 02:43 PM
change page number in the same sheet viman_in Excel Discussion (Misc queries) 1 June 18th 06 06:40 PM
Best way to inser file property into and excel sheet (cell) Luc Excel Discussion (Misc queries) 3 July 5th 05 08:36 PM
Change workbook sheet reference using cell A1 to change a vairable Reed Excel Worksheet Functions 4 January 20th 05 07:15 PM
Can't change in-cell dropdown property of cell... Wexler Excel Programming 0 September 30th 03 04:34 PM


All times are GMT +1. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"