Adding static character to a cell

F

Frank

I want to insert a $ in column of cells. Use currency as the format, but I
want the $ to stay in the cell so it can be used also when printed out. I
hope that's clear?
Thanks
Frank
 
B

Bob Phillips

Frank,

The $ in a currency format should also get printed. It is a view of the
data, but consistent on screen and print.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
G

GRCC

I know that, I didn't clarify my problem very well. .If this guy inserts an
amount, say $45., after he prints and clears the cell, the $ is gone of
course. Anyway to make it stay?
Thanks
Frank
 
D

Dave Peterson

Instead of clearing the contents of the cell, how about just typing a dollar
sign?
 
B

Bob Phillips

Following on Dave's idea

Private Sub Worksheet_Change(ByVal Target As Range)
Static prevValue

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Value = "" Then
Target.Value = "$"
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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