Use a checkbox to set cell format

C

clayton

Ok, I want to be able to select a checkbox to change the format of
cell. Normal format of the particular cell would be Currency ($) with
decimal places. If there is a check in the box to format the cel
Currency (Yen) or #,##0 ¥ (maybe). The other thing I am having
problem with is this. Sometimes we need to enter dollar amounts with
decimal places. I have only seen that I can have it with either 2 or
decimal places. Is there some way I can set an option to allow
decimal places sometimes? Like if someone types in 3 decimal place
then it won't round the numbers and still show the 3 places? But th
other fields still will show 2 decimal places. If I have not mad
myself clear here please let me know. And what the heck, while I’
asking for miracles, I also need a "checkbox" to say weather this i
yen or dollars. If its yen then insert the yen symbol in front of al
the currency fields. I know I am asking for a TON here but you guy
have all the experience
 
F

Frank Kabel

Hi
try something like the following:
Private Sub CheckBox1_Click()
If CheckBox1.Value Then
ActiveSheet.Range("A1").NumberFormat = "\$0.00"
Else
ActiveSheet.Range("A1").NumberFormat = "€0.00"
End If
End Sub

Adapt this to your needs. You can also change the format to 3 decimals,
etc.
 

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