+ Reply to Thread
Results 1 to 7 of 7

Looking for help merging 2 macros.

  1. #1
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Looking for help merging 2 macros.

    I have a bit of a complex issue.

    I have this Macro created by Xero Solus:

    Please Login or Register  to view this content.
    I need to modify it a bit for the following issues:

    1. The macro should check to see if a worksheet with the exact name already exists, and if so, do not re-create it.
    2. As each sheet is created, run the following macro on the newly created page:

    Please Login or Register  to view this content.
    the 2nd macro is hobbled together code and I'm sure it looks like crap, but it functions. If someone could help me clean this up and merge it together I would greatly appreciate it.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Looking for help merging 2 macros.

    Untested
    Please Login or Register  to view this content.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Re: Looking for help merging 2 macros.

    Hmm... I'm getting a run time error 1004 'This option is unavailable for this type of external database." I realise that this is impossible for you to test on your side because you have no access to our database.

    Here are my troubleshooting steps.

    1. I tested this on a brand new workbook placing my list on column D of sheet 1
    2. Running your new code created a new sheet for the first name on the list, placed the name in cell E1, then it produces the run time error with the debug highlighting this part of the code:
    Please Login or Register  to view this content.
    3. I copied my other macro in to this new workbook:
    Please Login or Register  to view this content.
    And this macro works just fine. It pulls the correct data from the external database with no error.

    Is there maybe another way to go about this that I can try?

    Thanks so much for your help.

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Looking for help merging 2 macros.

    Maybe
    Please Login or Register  to view this content.

  5. #5
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655
    Or maybe
    Please Login or Register  to view this content.
    Last edited by Solus Rankin; 08-23-2013 at 09:48 PM.

  6. #6
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Re: Looking for help merging 2 macros.

    unfortunately I'll have to wait until Mon morning to try these out. But thank you very much

  7. #7
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Re: Looking for help merging 2 macros.

    The first of the 2 you posted worked perfectly. Thank you for your help!!!!

+ 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. Merging macros together
    By NikonMan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2013, 08:39 PM
  2. Merging these 2 Macros
    By peterwithingtonuk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2010, 12:42 PM
  3. Question about merging macros
    By Vasant Nanavati in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 07:05 AM
  4. [SOLVED] Question about merging macros
    By Greegan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. [SOLVED] Merging 3 Workbooks without using macros
    By Mark Jackson in forum Excel General
    Replies: 1
    Last Post: 06-04-2005, 07: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