+ Reply to Thread
Results 1 to 5 of 5

Can This Macro for a command button be made to work in any book

  1. #1
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Surrey B.C.
    MS-Off Ver
    2013
    Posts
    155

    Can This Macro for a command button be made to work in any book

    Greetings,

    I am hoping to change this code I am using in the following way,

    Right now the code operates in the Book "1 INV EST JT TEMP 2016 INC"
    It copies specific cells and deposits it into "2018 INC LDGR DPST ALLOC"
    IT also inserts a new line in "2018 INC LDGR DPST ALLOC" and pushes the old data down the sheet.

    I wish to be able to use this code in a command button in any book I choose to put it in without having to continuously modify the code.

    The destination of the book("2018 INC LDGR DPST ALLOC") and sheet("WSBC LABOR PRODUCT TRACKER") would stay the same.

    Only the name of the book it comes from would continuously differ.
    The sheet ("Contract Job Tracker") where the information comes from would remain the same.




    [/CODE]



    Please Login or Register  to view this content.
    I guess it needs this part of the code to be Generic.

    [CODE]Call CLFILL("GENERIC BOOK NAME ??????", "2018 INC LDGR DPST ALLOC")

    Any help would be appreciated

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

    Re: Can This Macro for a command button be made to work in any book

    Probably just
    Please Login or Register  to view this content.
    assuming you are using the active workbook
    If you want something done right... find a forum and ask an online expert.

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

  3. #3
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Surrey B.C.
    MS-Off Ver
    2013
    Posts
    155

    Re: Can This Macro for a command button be made to work in any book

    Yes that works, now how do i get that particular macro to follow it to a new folder when the book is saved with a new name?

  4. #4
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Surrey B.C.
    MS-Off Ver
    2013
    Posts
    155

    Re: Can This Macro for a command button be made to work in any book

    and still work without editing the macro

  5. #5
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Surrey B.C.
    MS-Off Ver
    2013
    Posts
    155

    Re: Can This Macro for a command button be made to work in any book

    OK so I input the macro into the actual sheet instead of a module.

    This seemed to be the trick

    thanks 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. [SOLVED] Command button with macro does not work correctly
    By c_spooner1999 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-01-2013, 11:22 AM
  2. Button command doesnt work while calling a macro from a macro
    By bryan444 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2012, 09:39 AM
  3. [SOLVED] How to protect vba coding made in work book
    By srinivasan1965 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-16-2012, 06:58 AM
  4. Macro Doesn't Work With Command Button
    By jbmerrel in forum Excel General
    Replies: 4
    Last Post: 03-14-2012, 03:53 PM
  5. work book containing 50 worksheets -alphabetical order to be made.
    By gopalakrishnarao1 in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 04-29-2010, 09:24 AM
  6. U.S. Command Button Macro won't work in Australian version 2003
    By Ron in Dallas in forum Excel General
    Replies: 1
    Last Post: 12-23-2005, 01:15 PM
  7. Assign Macro to Command Button doesn't work
    By CLS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-31-2005, 01: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