-
Understood, but here's the basis for the underlying problem (my 2 cents worth)....
A text box automatically formats the cell using text format. i.e. the number (etc) is displayed exactly as entered without any dollar symbol or comma added to it. If you actually type in the dollar and comma when you make the entry in the text box then THAT is how it will be displayed instead and it will "fix".
The trouble is that each time you select a cell and make an entry with a text box it will automatically be assumed (BECAUSE it's a text box) that you are going to use text format, so you must specify any different format that you want to use for that cell.
If you HAVE already specified a format and made your entry, it will be displayed in that format (as I've shown above & below) - however, the instant the cell is RE-selected to view in the text box, it will be assumed that another entry {is to be}/{has been} made and it will be reformatted in 'text format' for the 'new' entry (even though no new entry was actually made)
What you need to do "keep" it as it was is to write code so that your new code 're-enters' the value and re-formats the cell every time it's been "looked at" (selected) OR, - use something other than a text box for your entry....
John 
PS here's another way - using your style - of doing the same thing as before....
[VBA]
.Worksheets("sheet1").Range("b3").Value = Me.TextBox1.Value
.Worksheets("sheet2").Range("a9").NumberFormat = "$ #,##0"
.Worksheets("sheet2").Range("a9").Value = Me.TextBox2.Value
[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules