Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jeff
 
Posts: n/a
Default A Follow up to Userform Formating

Hi,

Thanks for your help in the last post. There is one problem I am having
though. I need to input numbers into an input box in the userform, and I
would like the numbers formatted. I have the input box linked to a cell in
the workspace. But using the code

TextBoxPayments.value = format(Sheets("Input").Range("D8").Value, "$#,##0")
or
TextBoxPayments.value = Sheets("Input").Range("D8").text

Does not allow me to change the value in the input box, it sets the input
box to the value in D8. Is there any way around this so I can input values
that are formatted?

Thanks for your help
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default A Follow up to Userform Formating

I'd drop the linked cell and have the code change the value in the cell:

Option Explicit
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
With Me.TextBox1
If IsNumeric(.Value) Then
Worksheets("Input").Range("D8").Value = .Value
.Value = Format(.Value, "$#,##0")
End If
End With
End Sub



Jeff wrote:

Hi,

Thanks for your help in the last post. There is one problem I am having
though. I need to input numbers into an input box in the userform, and I
would like the numbers formatted. I have the input box linked to a cell in
the workspace. But using the code

TextBoxPayments.value = format(Sheets("Input").Range("D8").Value, "$#,##0")
or
TextBoxPayments.value = Sheets("Input").Range("D8").text

Does not allow me to change the value in the input box, it sets the input
box to the value in D8. Is there any way around this so I can input values
that are formatted?

Thanks for your help


--

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
Userform Formating Jeff Excel Discussion (Misc queries) 1 April 14th 06 03:56 PM
Cell to follow content AND/OR formating of another cell 0-0 Wai Wai ^-^ Excel Discussion (Misc queries) 1 September 8th 05 02:00 PM
Data Validation Cell - Move to UserForm thom hoyle Excel Worksheet Functions 0 April 28th 05 12:23 AM
Cell Content from UserForm Not Retained D.Parker Excel Discussion (Misc queries) 3 April 27th 05 04:56 PM
How can I run a macro in the background whilst a UserForm is visib cdb Excel Discussion (Misc queries) 3 February 10th 05 06:58 PM


All times are GMT +1. The time now is 07:50 AM.

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

About Us

"It's about Microsoft Excel"