+ Reply to Thread
Results 1 to 3 of 3

Apply Macro to a specific Workbook

  1. #1
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Apply Macro to a specific Workbook

    Hi all,

    I have the following basic macro:

    HTML Code: 
    basically it's a simple macro which removes duplicates.

    I would like to edit this macro so as when it is run it will be applied on a particular workbook, say "Workbook 1". However "Workbook 1" is not the active workbook but rather, it is another workbook which when the macro is run it will be closed.

    Can someone help me out ?

    Appreciate it a lot

    Thanks

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Apply Macro to a specific Workbook

    Try defining the workbook and worksheet (untested):
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Re: Apply Macro to a specific Workbook

    Thanks Berlan.

    It works good if the other workbook is open. However if the other workbook, i.e. 'WorkBook 1' is closed, it doesn't work.

    Is there a possible way around it?

    Thanks a lot !!

+ 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] Apply Macro to specific worksheets in workbook
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-17-2014, 02:45 PM
  2. [SOLVED] Macro that can apply a specific Macro to all sheets except first
    By Haidar123 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-01-2014, 10:56 AM
  3. Apply Macro to all files in a specific folder.
    By AntiPivotTable in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2013, 12:48 PM
  4. How to apply macro found in one workbook to another workbook
    By sellim in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2012, 02:12 PM
  5. vba code to apply a macro to a specific tab
    By 2seas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-09-2012, 02:03 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