+ Reply to Thread
Results 1 to 4 of 4

Use Recorded Macro in other Worksheets

  1. #1
    Registered User
    Join Date
    03-07-2016
    Location
    New Jersey
    MS-Off Ver
    2016
    Posts
    11

    Use Recorded Macro in other Worksheets

    Hi. I am still fairly new with Macros and VBA, and I’ve come across an issue with a using recorded Macros across different worksheets in a workbook. I have attached an example for reference. I have a filtered table in my “All” ws. My recorded macros takes that data and inputs at the end of the table in “Test2” ws. I then filter the data so it’s in order and ensure it looks like the rest of the table. I want to be able to use the Macro in “test1” and “test3”. My real Workbook has close to 29 different sheets I need to enter data into with a range of different names.
    Attached Files Attached Files

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Use Recorded Macro in other Worksheets

    This is to get you started. It eliminates the specific reference to the active sheet name and just deals with the 'ActiveSheet' constant. However, your 'FillDown' statements need some attention. When you use FillDown, you need to include the complete range refence that you want filled, including the range holding the data to be filled in. i.e. If data is in cell A10 and you want to fill the next 4 cells Then
    Please Login or Register  to view this content.
    Or you can use the copy method like you did for cell A34.

    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    03-07-2016
    Location
    New Jersey
    MS-Off Ver
    2016
    Posts
    11

    Re: Use Recorded Macro in other Worksheets

    Thanks JLGWhiz for the quick response. Unfortunately when testing this code on "Test1", I run into a "Run-time error'438': Object doesn't support this property or method" at " .ListObject.ListRows.Add AlwaysInsert:=False"

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Use Recorded Macro in other Worksheets

    Please Login or Register  to view this content.
    Maybe like this. I was not sure what the 'Selection' was in the original code, plus I do not normally work with tables. I am learning as I go here.
    Last edited by JLGWhiz; 10-02-2018 at 10:59 PM.

+ 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. Loop a recorded advanced filter macro through all worksheets
    By Bennett_Vic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2018, 10:56 AM
  2. Transferring Recorded Macro worksheets
    By justme1052 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2014, 05:14 AM
  3. [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
  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. 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
  7. [SOLVED] RE: Recorded macro won't run
    By rjamison in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2005, 08:05 PM

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