+ Reply to Thread
Results 1 to 2 of 2

one macro can run on different files

  1. #1
    Forum Contributor
    Join Date
    04-09-2013
    Location
    City, World
    MS-Off Ver
    Office 365
    Posts
    248

    one macro can run on different files

    Hi
    I recorded a simple macro and of course this macro can run on any sheet of this workbooks (book1) but to my surprise, if I go to File-->New--> Blank, and if I go to developer tab of Book2 and click on Macro, I see my macro from Book1 and I can run it. Then I open it totally different excel file from different folder and again, I can go to developer tab and macro and see the macro of Book1 and I can run it. So in summary the macro I created in Book1 can be run on all other excel files. Why is that? is that by design? I thought the macro should only run on the file that is created from. Thank you.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: one macro can run on different files


    Hi,

    normal behavior of VBA …

    But you can move your procedure to a specific worksheet module and set it as Private like you can see in VBA help for Sub …

+ 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. Macro for Creating one master data files from multiple files in the folder
    By NikhilDixit in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2017, 03:10 PM
  2. [SOLVED] Macro to Import Multiple TXT Files into workbook - User to select files/directory
    By saber007 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-15-2013, 08:43 PM
  3. Replies: 0
    Last Post: 04-13-2013, 10:45 AM
  4. Noob 4 Help - Macro to LIST ALL FILES IN FOLDER and then IMPORT ALL LISTED FILES
    By StlSmiln in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-25-2012, 04:02 AM
  5. Replies: 0
    Last Post: 03-15-2012, 04:13 PM
  6. A Macro to open 2 linked files copy 3rd files Input sheet
    By barrha0b in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2010, 09:53 PM
  7. Replies: 2
    Last Post: 11-30-2005, 01:55 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