+ Reply to Thread
Results 1 to 4 of 4

Recorded macro does other than while recording

  1. #1
    Registered User
    Join Date
    06-27-2017
    Location
    Laren, netherlands
    MS-Off Ver
    365
    Posts
    2

    Recorded macro does other than while recording

    I've got a file Afrekeningen.xlsm. I'v got a file Afrekening 15-06-2017.csv.
    When I record a macro to import the .csv to the .xlsm I get currency results in column C and cells B4 to B9.
    When i play the macro, the results are only digits in column C and no results in cells B4 to B9.

    The macro is recorded within the .xlsm file. Both files are includes in this post.
    Can somebody help me out to make this work?
    Attached Files Attached Files

  2. #2
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Recorded macro does other than while recording

    Hi,
    welcome to this formum.

    The problem with the numbers not showing in column B is with the decimal separator.
    The data comes with a dot as separator and then the macro replaces these dots by commas. Excel isn't handling that properly.

    Add these two properties to the connection
    .TextFileDecimalSeparator = "."
    .TextFileThousandsSeparator = ","
    and remove the lines replacing of dots by commas.

    This will give the macro as below:
    Please Login or Register  to view this content.
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

  3. #3
    Registered User
    Join Date
    06-27-2017
    Location
    Laren, netherlands
    MS-Off Ver
    365
    Posts
    2

    Re: Recorded macro does other than while recording

    Dear Tsjallie,

    Thank you so much for solving this problem.
    I'm never to old to learn and I'm grateful there is always someone to help.

    Kind regards,
    Frans Knuvers

  4. #4
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Recorded macro does other than while recording

    Hi Frans,
    glad I could help.
    If this solved your problem pls mark the thread SOLVED (see Thread Tools in the menu above).

    BTW, I noticed that this macro will create a connections each time you run it.
    Not sure if that's what you intend.

+ 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. Add If condition to a code recorded by Macro recording function in Excel
    By Emma_B in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2014, 01:36 AM
  2. [SOLVED] Recorded macro doing more than recorded?
    By Trending in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-26-2014, 11:42 AM
  3. [SOLVED] How to revised macro code to repeat the recorded task without recording several times?
    By reimar_rem in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2013, 01:34 AM
  4. [SOLVED] Recorded Pivot Table Macro Doesn't Do What I Recorded!
    By diakonos1984 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-26-2013, 11:01 AM
  5. [SOLVED] excel 2007 chart macro graphs data only from sheet on which macro was recorded
    By JW1028 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-19-2013, 06:33 PM
  6. Recording Macro to generate scatter plot: Plot from Macro different from recorded.
    By VaPiano in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2012, 05:41 AM
  7. Creating a macro which presses a button containing a recorded macro
    By petros89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2005, 10:05 AM

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