+ Reply to Thread
Results 1 to 7 of 7

Macro that is worksheet specific can't be found

Hybrid View

  1. #1
    Registered User
    Join Date
    02-13-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    21

    Macro that is worksheet specific can't be found

    I have a macro that I want to run as part of open event. I recorded the macro to copy and paste some columns on a worksheet. This macro will only work when I am on that worksheet.

    Since I want to run this macro as one of many applications when workbook is open and it doesn't always open on this specific worksheet I would like the code to target the worksheet and run the macro.

    Here is my code :
    Application.Run "'Workbook.xlsb'!Sheet5.Copy_Paste2"

    I get this message: "Cannot run the macro "..." The macro may not be available in the workbook or all macros may be disabled."

    I know macros are not disabled because the others ones that are not worksheet specific run just fine

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Macro that is worksheet specific can't be found

    where is the macro code located? in a worksheet module? is your workbook really called workbook.xlsb?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    02-13-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro that is worksheet specific can't be found

    No it's not called Workbook, I just didn't want to use the real name. The code is located in a module. I recorded the macro on the worksheet and I'm trying to run it as part of an open event with a couple of other macros that I wrote the code for and are not worksheet specific and those work just fine when called from the open event.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,758

    Re: Macro that is worksheet specific can't be found

    Is Copy_Paste2 declared as Public?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  5. #5
    Registered User
    Join Date
    02-13-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro that is worksheet specific can't be found

    I'm not sure. I just recorded it while on the tab and then tried to run it as part of the open event with two other macros that are not worksheet specific.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Macro that is worksheet specific can't be found

    replace your code by
    Sheet5.select
    call Copy_Paste2

  7. #7
    Registered User
    Join Date
    02-13-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro that is worksheet specific can't be found

    Thanks, JosephP, this works great when the tab is not hidden. Any clues on making this work while the tab is hidden?

    Looks like application.screenupdating method took care of this problem. Thanks for your help
    Last edited by ashokunbi; 10-31-2013 at 02:59 PM.

+ 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. Copying specific data to a specific field in a worksheet macro
    By bradpeh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2013, 01:52 AM
  2. [SOLVED] Macro Help: IF specific wording is found in a cell, THEN copy entire row to new sheet
    By csch123 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-13-2012, 03:16 PM
  3. fastest way to find the row where a specific text is found in a specific column
    By getgray in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2011, 02:45 PM
  4. Replies: 6
    Last Post: 10-15-2009, 10:33 AM
  5. Macro to Search column and if found, copy a cell within the worksheet
    By SKooT1027 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-16-2008, 01:12 PM

Tags for this Thread

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