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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

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,102,692
Messages
5,488,301
Members
407,634
Latest member
ps01

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top