Questions about formating....

N

Newbie1

When my Userform loads,
my Times change into text numbers (0.xxxxxxxx) and my numbers change into
TEXT
OK, so I need to use FORMAT(xxxx, , "hh:mm AMPM")

Question is, do I need to put this in both the LOADING AND the SAVING
portions?
Does it need to be in the

Sub FillTextBoxes
..TextBox8 = Format(ActiveCell.Offset(0, 7), "hh:mm AMPM")

AND

Sub textbox8_change()
ActiveCell.Offset(0, 7) = Format(TextBox8, "hh:mm AMPM")

When do I need to use the FORMAT?
In the HELP, it says something about "PREDEFINED NUMBER TYPES", yet I can
not find these... How do I use it for NUMBERS, as they are being changed to
TEXT

Thanks
 
N

Newbie1

Also, is there a way to "test" for the format of a given cell? Maybe assign
it to a varible and use that to maintain same formating?

Thanks
 
N

Newbie1

This makes all TEXT??
I am looking to format as a NUMBER. It is already convertting to TEXT. I
have dates/Times figured out. What I do not know, is do I want to format on
both the loading for the textboxes as well as on the save? Or do I just need
it on the SAVE only (textboxX_change)
Is there a method to find out the format of the existing data of a given
cell? This would allow me to step through each col and create a formatColX
varible to make sure I get the right format.

Thanks
 
T

Tom Ogilvy

maybe you missed it. Everything in a textbox is text. Using what I showed
you places the same format as used in the cell in the textbox.

There is no concept of SAVE associated with a textbox. Change fires on
every keystroke if entered manually - trying to perform formatting in the
change event is "goofy"

Afterupdate is probably more appropriate - but it depends on how you are
using your textboxes.

You probably need to break any links you have with your worksheet.
 
N

Newbie1

You are right, I missed what you were saying.

This seems to be "better" but some data is still wrong.

Would I also need to do a
ActiveCell.Offset(0, 7) = TextBox8.text
This appears to be working, but not sure if it is what I should be doing


?
 

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