Erich Duff
Board Regular
- Joined
- Apr 20, 2005
- Messages
- 129
All,
I'm getting a "Type Mismatch" error trying to run this code...anybody see what's wrong with it?
------------------------
Sub FormatChange()
If Cells("Criteria!E22") = "Sales" Then
Worksheets("Test").Range("C6:J18").NumberFormat = "$#,##0($#,##0)"
Else
Worksheets("Test").Range("C6:J18").NumberFormat = "0.00"
End If
End Sub
-------------------------
I have a list box whose criteria range points to a cell on another page, thus when that cell (on sheet Criteria, cell E22) reads Sales, I want the number format of the range on the page Test to be a dollar format, and otherwise just a 2-decimal number format. Can't seem to figure out what the problem is, though.
Thanks,
Erich
I'm getting a "Type Mismatch" error trying to run this code...anybody see what's wrong with it?
------------------------
Sub FormatChange()
If Cells("Criteria!E22") = "Sales" Then
Worksheets("Test").Range("C6:J18").NumberFormat = "$#,##0($#,##0)"
Else
Worksheets("Test").Range("C6:J18").NumberFormat = "0.00"
End If
End Sub
-------------------------
I have a list box whose criteria range points to a cell on another page, thus when that cell (on sheet Criteria, cell E22) reads Sales, I want the number format of the range on the page Test to be a dollar format, and otherwise just a 2-decimal number format. Can't seem to figure out what the problem is, though.
Thanks,
Erich