+ Reply to Thread
Results 1 to 4 of 4

Macro To Only Run on Specific Workbook

  1. #1
    Registered User
    Join Date
    08-12-2015
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    9

    Exclamation Macro To Only Run on Specific Workbook

    Hi there,

    I have a vba code that's linked to update dynamic chart within a worksheet.

    Please Login or Register  to view this content.
    It is working fine however, how do I make it so that MACRO only runs on specific workbook and worksheet.

    I've been having trouble when opening new documents it automatically protects the document with the same protect password.

    I was thinking of doing [Thisworkbook.Sheets("SheetName").Range] to specify what I wanted but It doesn't seem to be working.

    TL;DR - I do not want the macro to run for different workbook or worksheet. (Just 1 specific worksheet).

    Thanks

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Macro To Only Run on Specific Workbook

    where is the Sub held? in a Module or on a specific worksheets code?
    If someone has helped you then please add to their Reputation

  3. #3
    Registered User
    Join Date
    08-12-2015
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    9
    Quote Originally Posted by pjwhitfield View Post
    where is the Sub held? in a Module or on a specific worksheets code?
    In a specific worksheet code

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro To Only Run on Specific Workbook

    Hi ykim322

    Couple of observations...

    Where do you define this Variable...
    Please Login or Register  to view this content.
    Where do you set
    Please Login or Register  to view this content.
    At the top of every Module include this
    Please Login or Register  to view this content.
    Last edited by jaslake; 08-25-2015 at 07:22 PM.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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. Replies: 3
    Last Post: 02-21-2014, 09:05 AM
  2. [SOLVED] Changing macro from specific workbook to any workbook
    By spacle in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-10-2013, 11:24 AM
  3. Run Macro in closed workbook and copy specific coloumn in active workbook
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-07-2013, 03:43 AM
  4. Macro to exit all workbook leaving one specific workbook open
    By Khanzaki in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-22-2013, 05:09 AM
  5. Replies: 2
    Last Post: 04-15-2013, 09:06 AM
  6. [SOLVED] Print Macro to email PDFs of specific pages of a workbook to specific recipients
    By mike_vr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-26-2012, 12:34 PM
  7. [SOLVED] Macro to save workbook to specific folder with a specific name, then kill/disable itself.
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2012, 03:50 PM
  8. macro to copy specific data from many workbook to one workbook
    By anvesh.pune in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-05-2009, 01:14 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