Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default text to columns trouble with "zeros"

Hi

I want to get 01-0000000-00000001 to look like below...


Cell a1 = 01
Cell b1 = 0000000
Cell c1 = 00000001

I keep getting

Cell a1 = 1
Cell b1 = 0
Cell c1 = 1

I use "-" as my delimiter....


Thanks,
ExcelUser777

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default text to columns trouble with "zeros"

You have to specify that the output columns are Text, not General, in Step 3
of the Wizard.
Or if you record a macro of this action, you get something like:

Range("K1").Select
Selection.TextToColumns Destination:=Range("K1"), DataType:=xlDelimited, _
TextQualifier:=xlNone, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar
_
:="-", FieldInfo:=Array(Array(1, 2), Array(2, 2), Array(3, 2)), _
TrailingMinusNumbers:=True

NickHK

"ExcelUser777" wrote in message
s.com...
Hi

I want to get 01-0000000-00000001 to look like below...


Cell a1 = 01
Cell b1 = 0000000
Cell c1 = 00000001

I keep getting

Cell a1 = 1
Cell b1 = 0
Cell c1 = 1

I use "-" as my delimiter....


Thanks,
ExcelUser777



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default text to columns trouble with "zeros"

NickHK,

I tried setting the wizard in step 3 to "text" and that didn't work


Thanks,
lax_777


NickHK wrote:
You have to specify that the output columns are Text, not General, in Step 3
of the Wizard.
Or if you record a macro of this action, you get something like:

Range("K1").Select
Selection.TextToColumns Destination:=Range("K1"), DataType:=xlDelimited, _
TextQualifier:=xlNone, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar
_
:="-", FieldInfo:=Array(Array(1, 2), Array(2, 2), Array(3, 2)), _
TrailingMinusNumbers:=True

NickHK

"ExcelUser777" wrote in message
s.com...
Hi

I want to get 01-0000000-00000001 to look like below...


Cell a1 = 01
Cell b1 = 0000000
Cell c1 = 00000001

I keep getting

Cell a1 = 1
Cell b1 = 0
Cell c1 = 1

I use "-" as my delimiter....


Thanks,
ExcelUser777


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default text to columns trouble with "zeros"

For each of the fields?

I'd try it again.

ExcelUser777 wrote:

NickHK,

I tried setting the wizard in step 3 to "text" and that didn't work

Thanks,
lax_777

NickHK wrote:
You have to specify that the output columns are Text, not General, in Step 3
of the Wizard.
Or if you record a macro of this action, you get something like:

Range("K1").Select
Selection.TextToColumns Destination:=Range("K1"), DataType:=xlDelimited, _
TextQualifier:=xlNone, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar
_
:="-", FieldInfo:=Array(Array(1, 2), Array(2, 2), Array(3, 2)), _
TrailingMinusNumbers:=True

NickHK

"ExcelUser777" wrote in message
s.com...
Hi

I want to get 01-0000000-00000001 to look like below...


Cell a1 = 01
Cell b1 = 0000000
Cell c1 = 00000001

I keep getting

Cell a1 = 1
Cell b1 = 0
Cell c1 = 1

I use "-" as my delimiter....


Thanks,
ExcelUser777


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default text to columns trouble with "zeros"

Guys ... I should of realized that the first part of the string
changed...when I choose text...

It works !!!

thanks to Dave and NickHK



Dave Peterson wrote:
For each of the fields?

I'd try it again.

ExcelUser777 wrote:

NickHK,

I tried setting the wizard in step 3 to "text" and that didn't work

Thanks,
lax_777

NickHK wrote:
You have to specify that the output columns are Text, not General, in Step 3
of the Wizard.
Or if you record a macro of this action, you get something like:

Range("K1").Select
Selection.TextToColumns Destination:=Range("K1"), DataType:=xlDelimited, _
TextQualifier:=xlNone, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar
_
:="-", FieldInfo:=Array(Array(1, 2), Array(2, 2), Array(3, 2)), _
TrailingMinusNumbers:=True

NickHK

"ExcelUser777" wrote in message
s.com...
Hi

I want to get 01-0000000-00000001 to look like below...


Cell a1 = 01
Cell b1 = 0000000
Cell c1 = 00000001

I keep getting

Cell a1 = 1
Cell b1 = 0
Cell c1 = 1

I use "-" as my delimiter....


Thanks,
ExcelUser777


--

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
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Sort "text" numbers with and without leading zeros as numbers T.K. Excel Discussion (Misc queries) 1 February 10th 08 04:19 PM
Insert "-" in text "1234567890" to have a output like this"123-456-7890" Alwyn Excel Discussion (Misc queries) 3 October 25th 05 11:36 PM
How do I split "A1B2" into "A1" and "B2" using text to column fun. Jennifer Excel Programming 1 February 2nd 05 10:01 PM


All times are GMT +1. The time now is 06:31 AM.

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

About Us

"It's about Microsoft Excel"