VBA - Mixed formats in column

amarokWPcom

New Member
Joined
May 30, 2019
Messages
26
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???
 

Some videos you may like

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,115
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 :)
 

amarokWPcom

New Member
Joined
May 30, 2019
Messages
26
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?
 

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,115
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,100,182
Messages
5,473,001
Members
406,843
Latest member
David_Welland

This Week's Hot Topics

Top