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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
56,915
Office Version
  1. 365
Platform
  1. Windows
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?
 

baloobb

New Member
Joined
Jan 15, 2021
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
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
 

baloobb

New Member
Joined
Jan 15, 2021
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
Hi Joe4 thank you the error was in the regional settings!
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
56,915
Office Version
  1. 365
Platform
  1. Windows
You are welcome.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,467
Messages
5,636,456
Members
416,919
Latest member
twc2c

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
Top