+ Reply to Thread
Results 1 to 9 of 9

Trying to Transfer VBA from one Workbook to Another

  1. #1
    Forum Contributor
    Join Date
    02-12-2018
    Location
    TX
    MS-Off Ver
    MS Office 2019
    Posts
    305

    Trying to Transfer VBA from one Workbook to Another

    Hey everyone. So I have very minimal knowledge of VBA. Most of what is one these workbooks you fine folk helped me get...good job. I have two workbooks and a notepad with updated code attached. I'm trying to transfer the code from the workbook entitled Sample1, to the workbook entitled Slicers&Cad1. I have gone thru and changed the relevant information (sheet names, etc.) so that it is updated for the Slicers workbook. That is all listed on the notepad attachment...I may have to post this in a following post due to attachment restrictions. Been at this for a few hours now and I'm getting nowhere. Any help would be greatly appreciated. Tks.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-12-2018
    Location
    TX
    MS-Off Ver
    MS Office 2019
    Posts
    305

    Re: Trying to Transfer VBA from one Workbook to Another

    Here's the code
    Attached Files Attached Files

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

    Re: Trying to Transfer VBA from one Workbook to Another

    You can simply drag & drop the modules in the VBA Properties window of the VB editor

  4. #4
    Forum Contributor
    Join Date
    02-12-2018
    Location
    TX
    MS-Off Ver
    MS Office 2019
    Posts
    305

    Re: Trying to Transfer VBA from one Workbook to Another

    Interesting. Okay, well I've done that now, and saved it, but I'm getting an end/debug message...so thinking that something is off. And thanks for your help btw.
    Attached Files Attached Files

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

    Re: Trying to Transfer VBA from one Workbook to Another

    The PivotTable name & Item Number are different from the code

  6. #6
    Forum Contributor
    Join Date
    02-12-2018
    Location
    TX
    MS-Off Ver
    MS Office 2019
    Posts
    305

    Re: Trying to Transfer VBA from one Workbook to Another

    Not sure what I'm missing here...I'm well outside my breadth of knowledge with vba...I made the below changes but I don't think I'm on the right track.
    Set sh = Sheets("BuildMyBOM")
    Set pt = sh.PivotTables("PT_Parts")
    Set pf = pt.PivotFields("QTY")
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-12-2018
    Location
    TX
    MS-Off Ver
    MS Office 2019
    Posts
    305

    Re: Trying to Transfer VBA from one Workbook to Another

    Okay...figured out the what you were referencing with the Pivot table name. Changed that, and it's halfway working. Still at a loss with the ITEM NUMBER. That will probably stop the end/debug message. any help would be greatly appreciated. Thanks.
    Attached Files Attached Files

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Trying to Transfer VBA from one Workbook to Another

    Please Login or Register  to view this content.
    There is no underscore in field name "Item Number"
    Cheers
    Andy
    www.andypope.info

  9. #9
    Forum Contributor
    Join Date
    02-12-2018
    Location
    TX
    MS-Off Ver
    MS Office 2019
    Posts
    305

    Re: Trying to Transfer VBA from one Workbook to Another

    I THINK this might've fixed it...going to run through it a few times and see. Thanks everyone for all of 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. Workbook to workbook info transfer with dynamic names on button
    By jackers15 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-15-2017, 08:12 AM
  2. Replies: 4
    Last Post: 04-04-2016, 04:09 AM
  3. Replies: 3
    Last Post: 02-21-2014, 09:05 AM
  4. Transfer Data from Open workbook to Close workbook
    By alexnkc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-13-2013, 10:46 PM
  5. [SOLVED] Error 1004 when trying to modify and transfer data from one workbook to a new workbook
    By jecook in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2013, 02:51 AM
  6. Transfer Data from one workbook to worksheets in a closed workbook by criteria
    By jftapel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-21-2012, 05:23 AM
  7. transfer data from open workbook to closed workbook
    By stevesunfold in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 12-23-2008, 08:30 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