VBA - Mixed formats in column

amarokWPcom

New Member
Joined
May 30, 2019
Messages
25
Dear Friends,

I have a problem with a sheet:

I have an extract from SAP made by my VBA.

In the extract all columns are fine expect one column which is for quantities.
If the vba opens the file, this column is already broken (please find attached example file). Only some cells are still correct as you can see in the example if you compare it to the manually opened file.

The far right columns are how it has to be. All cells have to be numbers with the correct separator.

At the moment I have to break my code in pieces... open the file manully - changing the columns to format "numbers" - and proceed.

But this cannot be the way????

I guess the problem is because of the country code but I am not sure.

As you can see in the example I could find an algorythm which could correct me the column if opend by the code for surebut I am sure there is a even more easier way.

All my systems are in english, but em I am from Hamburg ;)

To opening in VBA I use the comand:

Workbooks.Open STR_EXTRACT_PATH & "ZPNBCEXTRACT.xls"

Ups.... How can I attach the example file here???
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Can you type into the text of a post, some different examples showing all the different types of formatting that you are getting ?

ALSO, if you are not comfortable posting on here in English, consider using the section on this board for questions in other languages.
Sorry, I speak a little German myself, but not enough to answer this question in German I'm afraid :-)
 
Upvote 0
Is my english that bad???

I will upload an example file to Gdrive or Dropbox when I am at home with the concrete definitions of the problem.

Thank you very much for your feedback, I hope you will he able to help me later?
 
Upvote 0
No your English is fine, I thought you yourself were hinting that you weren't comfortable using English when you said . . .
All my systems are in english, but em I am from Hamburg
:-)

Happy to carry on using English :-).

Having said that, if you upload something to Gdrive or Dropbox, I personally won't look at it, but others on this board might.

Like I said, if you can enter some different examples of your date directly into a post in this thread - maybe a screenshot of your data - then I will look at it.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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