Conditional Format (not color format)

G

Guest

and here i am once again:

i want to format a cell based on the value of another cell:

A1 - is set to 0, 1, 2, etc (0 & 2 represent a dollar amount; 1 represents a
% value)

cell A2 - describes 0 as a fixed dollar amount, 1 describes the value as a
percentage, 2 describes a fixed dollar amount also

the above i'm good at, and i have that part down.

the next part i need help with.

i want cell A3 to automatically format into a percentage or dollar based on
A1's value

if A1=0 or 2 ==> when i enter 6.25 in A3, i want the cell to show $6.25
if A1=1 ==> when i enter 6.25 in A3, i want the cell to show 6.25%

i tried conditional format, but all it really allows me to do is color the
cell.

any help will be appreciated.

jatman
 
G

Guest

You need a Change event sub for this:

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 1 Then
Select Case Target.Row
Case 1
Range("A3").NumberFormat = "General"
Case 3
Range("A3").NumberFormat = IIf(Range("A1") = 1, "0.00%", "$0.00")
End Select
End If
Application.EnableEvents = True
End Sub

Regards,
Stefi

„jatman†ezt írta:
 

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