+ Reply to Thread
Results 1 to 13 of 13

Need Help to Combine Two Macros Into a Single Macro

  1. #1
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Need Help to Combine Two Macros Into a Single Macro

    Hello,
    I have the below two Macros, but I would like to convert into a single Macro.

    Macro 1
    Please Login or Register  to view this content.
    Macro 2
    Please Login or Register  to view this content.
    Thank you
    Jr

  2. #2
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: Need Help to Combine Two Macros Into a Single Macro

    like this? it will run the RAW and then the SETUP macro

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Need Help to Combine Two Macros Into a Single Macro

    Hello,
    thank you for the reply. I tried to use the example, but it does not work. I do not believe the "Function GetHeaderColumn" can be at the end. I do believe it has to run before the Dinnerware_setup portion.

    Thank you

  4. #4
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Need Help to Combine Two Macros Into a Single Macro

    I note this part of the code is "ugly".

    Please Login or Register  to view this content.
    you select raw data and delete it then you are on some un specified sheet where you change the number format 3 times and select a column?

    maybe instead

    Please Login or Register  to view this content.
    But that probably wont fix your issue - maybe we need a sample file and maybe that personal.xlsb code.
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  5. #5
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Need Help to Combine Two Macros Into a Single Macro

    Hello,
    I just uploaded some samples.

    Running Macros in this order
    Dinnerware_Raw
    Dinnerware_Setup

    Setup is the final output.

  6. #6
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Need Help to Combine Two Macros Into a Single Macro

    looks like it works aside from your personal xlsb macros, which i think i see what they are doing...

    are you putting the code in module1?
    what error (incorrect data) did you get when you ran Kidrock's code?

  7. #7
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: Need Help to Combine Two Macros Into a Single Macro

    i would try scottiex's suggestion put all the code in module 1

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Need Help to Combine Two Macros Into a Single Macro

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  9. #9
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Need Help to Combine Two Macros Into a Single Macro

    Hello,

    Thank you. I have tried scottiex and bakerman2, but I seem to get the attached error. I am getting the carry over to Final Data, but it does not seem to be running,

    Columns("C:C").NumberFormat = "0"
    Application.Run "PERSONAL.XLSB!RemoveTags.RemoveTags"
    Application.Run "PERSONAL.XLSB!SeparateDataBySemiColon.SeparateDataBySemiColon"

    But if I run the original macros separate, it all works and I end up with the correct final output.

    Thank you,
    JR
    Attached Images Attached Images

  10. #10
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Need Help to Combine Two Macros Into a Single Macro

    looks like an acess privilege error.
    do you have a protected worksheet/book here? (although I don't know why merging the macros causes it to suddenly occur)
    if so have you set it to user interface only?

    Please Login or Register  to view this content.

  11. #11
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Need Help to Combine Two Macros Into a Single Macro

    Also if we have the personal xlsb code we could just put it in these macros instead of calling it from the personal.xlsb.
    then if we gave you code we could know it works in it's entirety.

  12. #12
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Need Help to Combine Two Macros Into a Single Macro

    Hello,

    Sorry about that issue. I have included a text file which shows the other two macros in question.

    Thanks Jr
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Need Help to Combine Two Macros Into a Single Macro

    Does this work for you?

    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. [SOLVED] How to combine shortcuts into a single macro - syntax
    By churchwidow in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-19-2021, 03:39 AM
  2. Macro to combine multipe rows into single row
    By mistye525 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2013, 02:50 PM
  3. VBA/Macro help need to combine row data into single cell
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2013, 06:52 AM
  4. [SOLVED] Need to create a macro that will combine 2 other macros plus
    By rjackson104 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-02-2013, 02:45 AM
  5. [SOLVED] Combine 3 Macros into one Macro
    By Floydlevedale in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2013, 05:40 AM
  6. Macro Command Button: Combine Save As CSV and Delete Unsed Rows Macros
    By mustng_sally in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2013, 10:41 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