+ Reply to Thread
Results 1 to 5 of 5

Check and change SAP Excel Download monetary formats i.e. swap . for , and , to . if incor

  1. #1
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Question Check and change SAP Excel Download monetary formats i.e. swap . for , and , to . if incor

    Hi,

    My problem is every week I import data from as SAP download (in an Excel.xls format) into a template Excel file, however, on occasions the SAP download for some unknown reason will change , (commas) to. (periods) in columns that contain monetary values e.g. 1.234,56

    So under normal circumstances the value from SAP would be in this format 1,234.56 but occasionally the format would be 1.234,56

    Can anyone please advise me of the VBA code to check my data in say in column ‘A’ (please attached Example file) to check if it’s in the correct format e.g. 1,234.56 and if not change the format i.e. change the , (commas) to. (periods) and the . (periods) to (commas)

    Any assistance in this matter would be greatly appreciated

    Many thanks in advance

    Regards

    Rob
    Attached Files Attached Files
    Rob

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Check and change SAP Excel Download monetary formats i.e. swap . for , and , to . if i

    I do not see any VBA code in your example file.
    How do you "import" the data into excel? does SAP provide an addin that allows you to retrieve the data from or do you simply download the information in sap yourself (or a collegue) and after that open the downloaded excel file in excel?
    also your profile does not state any version of Excel. It is helpfull to know which version you are using for this job, so other options might be available too to tackle this problem..

    It is important to know as there is little point in just building random VBA code when it might interfere with other code in use eighter self build or available thru an addin.
    Last edited by Roel Jongman; 05-22-2018 at 07:41 AM.

  3. #3
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Check and change SAP Excel Download monetary formats i.e. swap . for , and , to . if i

    Roel Jongman,

    sorry I should have said the import is manual so I will need macro/VBA to run after I have imported the data manually

    Regards


    Rob

  4. #4
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Check and change SAP Excel Download monetary formats i.e. swap . for , and , to . if i

    would a manual solution suffice then too? there is a few easy search and replace tricks that will fix your problem too..

    do 2 search and replace actions. when the numbers show as 1.234,56

    Delete thousand separators.
    1. Select the problem column
    2. put . in seachbox and leave replace field empty
    3. choose replace all

    replace decimal separators
    1. select problem column (with removed thosandseparators)
    2. put , in the search box and . in the replacebox
    3. choose replace all.

    - make sure you do this only on a selected column. If you search and replace on the whole sheet any descriptions containing point of comma might be affected by the search and replaced too


    Also have a look at the options of SAP download and see if you can make downloads without thousand separators. they are not needed and the cause of the problem
    Excel will identify numbers with only the wrong decimal separators but no thousandseparators as numbers.
    But when thousand separators are in the numbers excel does not resolve it herself.

    the thousand separator can be shown in excel easily by re-formatting the column

  5. #5
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Check and change SAP Excel Download monetary formats i.e. swap . for , and , to . if i

    Roel Jongman,

    I did try this and it works, that said, if the data is in the correct format in the first place it will put it in the format I'm trying to amend, and hence the need for some VBA script to check the format in the first instance and then run some code to amend if required.


    Regards

    Rob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Change/swap page numbers
    By Finalfrontier1976 in forum Excel General
    Replies: 0
    Last Post: 05-26-2017, 05:29 AM
  2. [SOLVED]Function to add total monetary values within a row.
    By communistflamingo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-31-2014, 03:20 PM
  3. Replies: 4
    Last Post: 06-16-2014, 11:23 PM
  4. Check Box to swap between having a formula in a cell and displaying text
    By anit999 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2013, 04:59 AM
  5. How to Check Date formats in Excel
    By Karthik Sen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2012, 03:19 PM
  6. Can a Check Box swap Formulas
    By rbpd5015 in forum Excel General
    Replies: 3
    Last Post: 06-30-2010, 05:20 PM
  7. [SOLVED] Excel should allow me to change default number formats
    By kakers in forum Excel General
    Replies: 1
    Last Post: 01-11-2006, 07:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1