Text To Columns vba producing different results on differents pc

baloobb

New Member
Joined
Jan 15, 2021
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
Hi all,

I have a problem, I set up a macro to format a column (fixed-width) with a date format DMY. It works fine on my PC but on a colleague's pc, it isn't working.

Here the code
VBA Code:
Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(0, 4), TrailingMinusNumbers:=True

Row data are formatted as general.
Planned_Start_Date
17/01/2021
11/01/2021
11/03/2021
14/04/2021

Why only on my pc the code works fine? Am I missing something?

Thanks to whom can help my to sort it out
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Welcome to the Board!

What exactly do you mean by it isn't working on your colleague's PC?
Are you getting errors? If so, what?
Or are you getting unexpected results? If so, what?

Also answer the following questions:
1. Are you both trying it on the EXACT same file?
2. Are Macros/VBA enabled on the other computer?
3. Are you both using the same version of Excel?
4. Do you both have the same regional settings?
 
Upvote 0
Thank you to have me on board!

Sorry, I forgot to mention, the same scenario, the only thing that is different is the pc.

1. Are you both trying it on the EXACT same file? YES
2. Are Macros/VBA enabled on the other computer? YES
3. Are you both using the same version of Excel? YES
4. Do you both have the same regional settings? need to check, this could be the problem

What I got is the date in the right way, dd/mm/yyyy while he gets the data in the wrong format mm/dd/yyyy

thank you
 
Upvote 0
Hi Joe4 thank you the error was in the regional settings!
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,424
Members
448,961
Latest member
nzskater

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