+ Reply to Thread
Results 1 to 2 of 2

Duplicating Macro & Changing Reference/Name

  1. #1
    Registered User
    Join Date
    01-31-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Duplicating Macro & Changing Reference/Name

    Hey folks,

    Hopefully this is pretty straight-forward. I can't seem to figure it out.

    I have this bit of code for a short macro to be run on a button push:

    Please Login or Register  to view this content.
    Basically I'd like to make a couple hundred copies of this Macro, 1 to be used for each button. Obviously each one would need a new name (AddItem2, AddItem3, so on) and the only reference I need changed is that row number (32 in this case).

    As an added bonus if anyone would know how to loop through all the form buttons on my page with name 'Add Item' and assign the macro to each one 1 by 1 in order that would be amazing. That part isn't too much work to do manually, however.

    Totally open to any other solutions to go about this as well. Each button exists on a different row so I don't know if it's possible to find the current row number of a button and to change the 'D32' reference to the specific row number of the button pushed. That may be a lot easier as well.

    Thanks so much!

  2. #2
    Registered User
    Join Date
    01-31-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Duplicating Macro & Changing Reference/Name

    Nevermind, thanks. Figured it out!

    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 Stop Macro From Requiring File Open Prompt When Changing External WB Reference?
    By justinbelkin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-16-2013, 02:34 PM
  2. Duplicating Charts with changing values
    By zoltain in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 06-13-2011, 03:46 PM
  3. Data Duplicating in Macro
    By Brendan4483 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2008, 02:36 PM
  4. Replies: 0
    Last Post: 11-15-2007, 02:35 AM
  5. Replies: 2
    Last Post: 04-20-2006, 08:20 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