Text to Columns Excel 2007

tomjakpl

New Member
Joined
Aug 24, 2011
Messages
4
Dear All,

I have a problem with Text to Columns in Excel 2007.
Could you please explain me, how does it work (I mean what's inside)?
The problem is:
Sometimes Vlookup function does not work but when I use TtC with the values defined as "Table Array" it starts to work!
My steps:
1) Highlight the column with values that need to be found in Table Array
2) Click TtC
3) Delimited - checked
4) Finish
So... What's the magic?

And the other issue with TtC:
When I record a macro (all steps above) and then try to run it I get a mess with commas and dots - It seems that it has problems with decimal and thousands separators but I do not know what's exactly an issue.
What's interesting there is no such a problem when I do it manually...

Looking forward to any help.

Best regards
Tomasz
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Thanks, however just format changing is not enough. Is there any other way to convert text to numbers?
 
Upvote 0
It does convert text numbers to numbers. Here is what the macro recorder gave me in Excel 2010.

Code:
Sub Macro2()
'
' Macro2 Macro
'

'
    Range("A1:A5").Select
    Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
        Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
        :=Array(1, 1), TrailingMinusNumbers:=True
End Sub
 
Upvote 0
I get the same. Problem is: when I run this code, it changes all commas (decimal sep) to dots (thousands sep).
There is no such a problem when do it manually.
 
Upvote 0
Sorry, I can't test that or suggest a solution as I use dot as the decimal separator and comma as the thousands separator.

When I run the code it doesn't change the dots.
 
Upvote 0
Thank you.
After changing my regional settings in Windows Vista to USA (instead of Poland) it works fine.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top