Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default formatting cells

I am attempting to have certain cells on a spreadsheet format based on
the contents of a single cell. I have tried the following code byt get
a "type mismatch" error. Any suggestions??

Sub FormatIncStmtAssump()
If Sheets("IncStmtAssump").Range("B11").Value = "% of Revenue" Then
Sheets("IncStmtAssump").Range("C11:H11").Value =
Format(Sheets("IncStmtAssump").Range("C11:H11").Va lue, "0.00%")
If Sheets("IncStmtAssump").Range("B11").Value = "Input" Then
Sheets("IncStmtAssump").Range("C11:H11").Value =
Format(Sheets("IncStmtAssump").Range("C11:H11").Va lue, "$#,##0")
If Sheets("IncStmtAssump").Range("B11").Value = "$ Change from
Previous Year" Then Sheets("IncStmtAssump").Range("C11:H11").Value =
Format(Sheets("IncStmtAssump").Range("C11:H11").Va lue, "$#,##0")
End Sub


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default formatting cells

Sheets("IncStmtAssump").Range("C11:H11").NumberFor mat = _
"0.00%"

Might be what you want.

--
Regards,
Tom Ogilvy


"bforster1 " wrote in message
...
I am attempting to have certain cells on a spreadsheet format based on
the contents of a single cell. I have tried the following code byt get
a "type mismatch" error. Any suggestions??

Sub FormatIncStmtAssump()
If Sheets("IncStmtAssump").Range("B11").Value = "% of Revenue" Then
Sheets("IncStmtAssump").Range("C11:H11").Value =
Format(Sheets("IncStmtAssump").Range("C11:H11").Va lue, "0.00%")
If Sheets("IncStmtAssump").Range("B11").Value = "Input" Then
Sheets("IncStmtAssump").Range("C11:H11").Value =
Format(Sheets("IncStmtAssump").Range("C11:H11").Va lue, "$#,##0")
If Sheets("IncStmtAssump").Range("B11").Value = "$ Change from
Previous Year" Then Sheets("IncStmtAssump").Range("C11:H11").Value =
Format(Sheets("IncStmtAssump").Range("C11:H11").Va lue, "$#,##0")
End Sub


---
Message posted from http://www.ExcelForum.com/



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
condionally formatting based on another cells formatting? Derrick Excel Discussion (Misc queries) 2 July 31st 09 08:05 PM
conditionally formatting cells based on other cells Derrick Excel Discussion (Misc queries) 1 July 7th 09 09:43 PM
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Formatting Cells Gerry Cornell Excel Discussion (Misc queries) 6 January 5th 07 12:41 AM
Conditional Formatting Multiple cells based on 2 cells Louis Markowski Excel Worksheet Functions 2 June 1st 05 05:26 PM


All times are GMT +1. The time now is 06:35 AM.

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

About Us

"It's about Microsoft Excel"