Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a problem!
I am writing a macro where the user pastes in a 16 digit number into a text box on a user form. This then becomes a variable (long). I need the macro to edit this variable by placing a space after the 4th, 8th and 12th number. ie, from this: ################ to this: #### #### #### ####. Is this possible? Thanks, Peter |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Peter,
If you want to embed spaces, it can't go into a Long variable, it will have to be a String. With Me.TextBox1 sVar = Format(.text,"0000 0000 0000 0000")) End With -- --- HTH Bob (change the xxxx to gmail if mailing direct) "Peter" wrote in message ups.com... I have a problem! I am writing a macro where the user pastes in a 16 digit number into a text box on a user form. This then becomes a variable (long). I need the macro to edit this variable by placing a space after the 4th, 8th and 12th number. ie, from this: ################ to this: #### #### #### ####. Is this possible? Thanks, Peter |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob,
You are right, it is a string. Thanks for the code but it is still not working. I am not sure what it is, can you help? Thanks, Peter |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is your textbox on a userform?
Describe how it is not working please. -- --- HTH Bob (change the xxxx to gmail if mailing direct) "Peter" wrote in message oups.com... Bob, You are right, it is a string. Thanks for the code but it is still not working. I am not sure what it is, can you help? Thanks, Peter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
adding spaces | Excel Discussion (Misc queries) | |||
Adding Spaces to the end of a value | Excel Worksheet Functions | |||
Adding spaces to a cell | Excel Discussion (Misc queries) | |||
Remove spaces from a string variable | Excel Programming | |||
Remove spaces from a string variable | Excel Programming |