Closed Thread
Results 1 to 5 of 5

[VBA] Need help on (theoretical) how-to add some code into existing one

  1. #1
    Registered User
    Join Date
    11-11-2021
    Location
    France
    MS-Off Ver
    2021
    Posts
    22

    Unhappy [VBA] Need help on (theoretical) how-to add some code into existing one

    Hi all,

    Prelude : I can't share the file as it contains critical data.

    quick rundown on my problem : there is an existing macro that runs fine. We have a special case that isn't properly handled by the current code, as it would require some custom input. The current code concatenates a whole bunch of info to generate csv files and then launch another application to print files, depending on some info from the macro.

    How the macro works : it starts with a a choice to make between two mediums ; then we enter an ID. From there, the macro will extract data from two databases. We will determine some priorities, some actions to be undertaken, and finally, the macro will choose a case from a previous input. A CSV is generated, and a link opens an app from which we will use a template, depending on the case we chose earlier. (I hope it's clear)

    Where I'm stuck : I'm not sure how to wedge my own code into this. I'm not even sure what best option would be. The CSV won't generate if it doesn't have all info ; however, in some custom cases, we don't have all that info.

    I imagined I could create a sort of "fork" in the code, but I have no idea how to execute this, if possible. Can I stop the macro, deviate it, and then say "resume from that point" ?

    I know it's cryptic without the file... maybe I can try and edit it completely, but there's still the risk I can let info slip, and we wouldn't want that. I guess I could use any guidance and go from there ? If this post is useless, feel free to disregard/delete it.

    Thanks for any help !

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,981

    Re: [VBA] Need help on (theoretical) how-to add some code into existing one

    Please share the existing code.

    Administrative Note:

    Is your forum profile showing the version of Excel that you need this to work for?

    Members will tailor the solutions they offer to the version of Office (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this.

    The three most recent versions of Excel are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the release number in your profile (e.g. MS365 Version 2211). This is in the About Excel section further down the Account page.

    Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: [VBA] Need help on (theoretical) how-to add some code into existing one


    Salut !

    Quote Originally Posted by eawyne View Post
    Prelude : I can't share the file as it contains critical data.
    « Pas de bras, pas de chocolat ! »

    As you can attach a sample workbook without any critical data but respecting exactly the original layout
    and accordingly attach the exact expected result text file
    with a crystal clear step-by-step explanation in order there is nothing to guess …

  4. #4
    Registered User
    Join Date
    11-11-2021
    Location
    France
    MS-Off Ver
    2021
    Posts
    22

    Re: [VBA] Need help on (theoretical) how-to add some code into existing one

    Then please delete this post ; the code is riddled with variables that contain infos and names that cannot be shared. There would be no point for me to expurge it from that data as the code wouldn't even be functionnal or readable.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,981

    Re: [VBA] Need help on (theoretical) how-to add some code into existing one

    Thread closed at the OP's request.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need Help With A Top 8 Formula, for theoretical numbers.
    By scandydave in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-22-2021, 11:08 AM
  2. [SOLVED] Adapting Existing Code to Offer Option to Save to Existing Folder
    By AliGW in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-28-2019, 07:37 AM
  3. update existing code to copy and KEEP existing data
    By scott micklo in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 01-26-2016, 05:41 PM
  4. [SOLVED] Correct way to apply an existing VBA code to an existing sheet
    By JO505 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2013, 05:42 PM
  5. Theoretical Average Computation
    By J-Roc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-11-2009, 08:09 PM
  6. Replies: 1
    Last Post: 08-15-2009, 05:52 AM
  7. theoretical size question
    By excellentexcel in forum Excel General
    Replies: 12
    Last Post: 01-21-2009, 07:45 AM

Tags for this Thread

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