formatting cells

B

bforster1

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").Value, "0.00%")
If Sheets("IncStmtAssump").Range("B11").Value = "Input" Then
Sheets("IncStmtAssump").Range("C11:H11").Value =
Format(Sheets("IncStmtAssump").Range("C11:H11").Value, "$#,##0")
If Sheets("IncStmtAssump").Range("B11").Value = "$ Change from
Previous Year" Then Sheets("IncStmtAssump").Range("C11:H11").Value =
Format(Sheets("IncStmtAssump").Range("C11:H11").Value, "$#,##0")
End Sub
 
T

Tom Ogilvy

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

Might be what you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top