+ Reply to Thread
Results 1 to 10 of 10

How to combine working macros?

  1. #1
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    How to combine working macros?

    Hello everyone, if possible, I would like for both macros below to be converted into one but I do need a few changes before that.

    The macro below "CreateSpecial" works when I first open the workbook. If I delete the tab it created and run it again, it doesn't run because the next sheet the macro creates is named "Sheet2" so I get a "Subscript out of range" error. Any ideas on what I need to change to make it work?

    Please Login or Register  to view this content.
    The macro below works well, but I am open to suggestions if there is something I can do to make it run faster. The only change I would like other than merging it to the top one is if I can somehow bring the header from tab named "work".

    Please Login or Register  to view this content.
    Last edited by AccountingJ; 10-15-2019 at 12:30 PM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: How to combine working macros?

    FWIW Not a VBA man, but the VBA Gurus usually add a line to disable automatic calculation at the start and enable it at the end of the macro
    Please Login or Register  to view this content.
    and the
    Please Login or Register  to view this content.
    at the beginning of the macro after the Dim statements

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: How to combine working macros?

    How about
    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: How to combine working macros?

    And for the other macro try
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to combine working macros?

    Thanks, the first macro worked well, the second one didn't transfer any data though.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: How to combine working macros?

    Do you have any cells in column H with "special customer"?

  7. #7
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to combine working macros?

    sir my apologies, it was a mistake on my end, too long of a story but your second macro was an improvement speed wise.

    Thank you and you Pepe

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: How to combine working macros?

    You're welcome & thanks for the feedback

  9. #9
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to combine working macros?

    Kind of an embarrassing question, but why do the autofilters stay on?

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: How to combine working macros?

    Because I forgot to turn them off

    Add this
    Please Login or Register  to view this content.

+ 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. Need help to Combine 2 VBA macros
    By gopibiotech08 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-30-2018, 10:39 AM
  2. Need to Combine 3 Macros
    By vibajajo64 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2018, 01:12 PM
  3. [SOLVED] How to combine two macros
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2017, 11:47 AM
  4. Combine 3 macros into one
    By zain_shaikh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2015, 08:24 AM
  5. [SOLVED] Combine 2 working Macros into One
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2014, 04:35 PM
  6. Combine macros
    By rabsocket1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2014, 12:46 PM
  7. Combine 2 Macros into 1
    By anwood1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2013, 11:37 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