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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

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.
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,083
Messages
5,509,158
Members
408,711
Latest member
EMexcel

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top