+ Reply to Thread
Results 1 to 5 of 5

proper copying 1 macro to other similar excel file - so it'll work

  1. #1
    Forum Contributor
    Join Date
    05-12-2013
    Location
    Tel Aviv, Israel
    MS-Off Ver
    Excel 2021
    Posts
    112

    proper copying 1 macro to other similar excel file - so it'll work

    Hello , I'm trying to use the macro in U1.xlsm in U2.xlsm but I'm a beginner , and can't figure out how to do it.
    what I'm trying to do is to copy the working macro from U1 to U2, (without deleting sheets) .
    I'm curious why I wasn't able to do it, will like to learn how to . thanks
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: proper copying 1 macro to other similar excel file - so it'll work

    Like here?: U2.xlsm

    What I did:
    1. Enter Design Mode in Developer Tab and copy/paste the button into the U2 workbook.
    2. Create a Module in U2 and copy the code from Modul1 U1 into it
    3. Copy the code from the worksheet module in U1 to the worksheet module where the button is
    4. Change the target range for the text form inpputbox From E3 to E2
    5. Remove the Named Range 'Receipe name"
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Forum Contributor
    Join Date
    05-12-2013
    Location
    Tel Aviv, Israel
    MS-Off Ver
    Excel 2021
    Posts
    112

    Re: proper copying 1 macro to other similar excel file - so it'll work

    thanks again tehneXus, even though I don't know exacly how this macro works- it's just works great.

    Just thinking on a future scenerio - I want to add a lot of macros, vb codes, formulas in the template sheet so I'll add as the time goes, Can I do it without worries for errors ? (specialy the error of : "the cell name "X" is already exist - do you want to use it independently?...") ?
    and is it have any meanings to try to keep the Named Range 'Receipename" so it'll work anyway , for now - If that named range won't removed - it'll show this error every time I'll add new one :"recipename already exist" - why it ask for this name approval and other names not (I'm worry that I'll accedently do something and it'll start to ask me for a lot lot more names approval
    Last edited by netanel99; 06-09-2013 at 11:50 AM.

  4. #4
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: proper copying 1 macro to other similar excel file - so it'll work

    Hi,

    honestly I am not used to named ranges as I rarely use them.
    I'd just start working on the template, testing functionality carefully and in case there will be an error, investigate.

  5. #5
    Forum Contributor
    Join Date
    05-12-2013
    Location
    Tel Aviv, Israel
    MS-Off Ver
    Excel 2021
    Posts
    112

    Re: proper copying 1 macro to other similar excel file - so it'll work

    I read you. thank you for your help. This is a great feature, will use it anywhere I can in excel. thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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