Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
condionally formatting based on another cells formatting? | Excel Discussion (Misc queries) | |||
conditionally formatting cells based on other cells | Excel Discussion (Misc queries) | |||
Formatting cells in a column with conditional formatting? | Excel Discussion (Misc queries) | |||
Formatting Cells | Excel Discussion (Misc queries) | |||
Conditional Formatting Multiple cells based on 2 cells | Excel Worksheet Functions |