Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default display $ sign in excel sheet

Hi All, I want to display a '$' sign in excel sheet once user inputs the
'amount'. the cell in excel is populated through a userform. Here is my code
to format the textbox in userform:

Amount.Text = Format(Amount.Text, "$#,###.00")

I am getting the $ sign in the text box field, but once its populated in
excel sheet I dont see the $ sign, I just see 6,444.00
Here is my code to print the input in excel through the userform:

ws.Cells(10, 8).Value = Me.Amount.Value

Thanks in Advance




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default display $ sign in excel sheet

Apply the number format you want:

with ws.Cells(10, 8)
.numberformat = "$#,###.00"
.Value = Me.Amount.Value
end with



sam wrote:

Hi All, I want to display a '$' sign in excel sheet once user inputs the
'amount'. the cell in excel is populated through a userform. Here is my code
to format the textbox in userform:

Amount.Text = Format(Amount.Text, "$#,###.00")

I am getting the $ sign in the text box field, but once its populated in
excel sheet I dont see the $ sign, I just see 6,444.00
Here is my code to print the input in excel through the userform:

ws.Cells(10, 8).Value = Me.Amount.Value

Thanks in Advance


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default display $ sign in excel sheet

Right-click the tab, and paste this code into the window that opens:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set H = Range("A:H")
s = "$"
If Intersect(t, H) Is Nothing Then Exit Sub
Application.EnableEvents = False
t.Value = s & t.Value
Application.EnableEvents = True
End Sub

Format as Currency. Oh, change the range to suit your needs...

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Dave Peterson" wrote:

Apply the number format you want:

with ws.Cells(10, 8)
.numberformat = "$#,###.00"
.Value = Me.Amount.Value
end with



sam wrote:

Hi All, I want to display a '$' sign in excel sheet once user inputs the
'amount'. the cell in excel is populated through a userform. Here is my code
to format the textbox in userform:

Amount.Text = Format(Amount.Text, "$#,###.00")

I am getting the $ sign in the text box field, but once its populated in
excel sheet I dont see the $ sign, I just see 6,444.00
Here is my code to print the input in excel through the userform:

ws.Cells(10, 8).Value = Me.Amount.Value

Thanks in Advance


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 - display negative numbers with minus sign and parenthe Nadine Excel Discussion (Misc queries) 3 July 2nd 09 09:13 PM
How to display $ sign in front of: 50 under, 50 over misona1 Excel Discussion (Misc queries) 5 October 8th 08 04:01 AM
Display sign on a chart Felicity Charts and Charting in Excel 3 April 19th 07 04:46 PM
How do I display a cent sign Mike Excel Discussion (Misc queries) 1 September 29th 06 05:38 PM
display plus sign on plus numbers in Excel tnoble Excel Discussion (Misc queries) 1 November 19th 05 02:28 PM


All times are GMT +1. The time now is 10:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"