Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
#Holding values in different format#
Hi,
A 16 digit number is to be entered into a vbform textbox, on leaving or pressing enter, I would like this number: e.g abcdefghijklmnop to be displyed in this format: abcd efgh ijkl mnop Can anyone help? Thanks Dean |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
#Holding values in different format#
did you try just formatting the cell?
like "### ### ###" for example if its a text string that you need rather than leaving the data as a number, then you could use someting like txt = textbox1.text MyText = left(txt,4) & " " & mid(txt,5,4) & " " MyText =MyText & mid(txt,9,4) & " " & right(txt,4) Patrick Molloy Microsoft Excel MVP -----Original Message----- Hi, A 16 digit number is to be entered into a vbform textbox, on leaving or pressing enter, I would like this number: e.g abcdefghijklmnop to be displyed in this format: abcd efgh ijkl mnop Can anyone help? Thanks Dean . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
#Holding values in different format#
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1 = Left(TextBox1, 4) & " " & Mid(TextBox1, 5, 4) & " " _ & Mid(TextBox1, 9, 4) & " " & Mid(TextBox1, 13, 4) End Sub Any characters over 16 will be dropped. -- Vasant "Dean Knox" wrote in message ... Hi, A 16 digit number is to be entered into a vbform textbox, on leaving or pressing enter, I would like this number: e.g abcdefghijklmnop to be displyed in this format: abcd efgh ijkl mnop Can anyone help? Thanks Dean |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Indirect formulas in cells not holding cell format after copy | Excel Worksheet Functions | |||
Concatenate numbers and text while holding a custom number format. | Excel Worksheet Functions | |||
holding the result constant | Excel Worksheet Functions | |||
holding a value after first calcuation | Excel Worksheet Functions | |||
Cells not holding format | Excel Discussion (Misc queries) |