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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

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,101,934
Messages
5,483,769
Members
407,409
Latest member
natshafernandes

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top