+ Reply to Thread
Results 1 to 2 of 2

Macro not working properly when called from Button (Running otherwise)

  1. #1
    Registered User
    Join Date
    03-04-2016
    Location
    India
    MS-Off Ver
    2013
    Posts
    3

    Macro not working properly when called from Button (Running otherwise)

    I have a macro which was running from a long time. Suddenly it stopped working. Upon digging I found out that the macro is not running properly only when it is called from the button. If I try the macro through F8 or Developer Tab everything seems to work fine.

    The exact issue is that when called from button the code which is supposed to copy an entire sheet from one workbook to another sheet of a different workbook is pasting the content from below cell instead of A1. As a result excel is not able to paste.

    This is only happening when called from button.Has anyone faced this issue.

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    Please Login or Register  to view this content.
    The error is happening at the last two lines.
    Last edited by 6StringJazzer; 03-05-2016 at 10:34 AM.

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

    Re: Macro not working properly when called from Button (Running otherwise)

    Quote Originally Posted by AnimeshRoy View Post
    The error is happening at the last two lines.
    What is the error, exactly? Errors do not happen on two lines, they happen on one line. Which line causes the error?

    I don't think this is your problem but the code that I would use for those lines is

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. Close button not working properly
    By Damian37 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-09-2014, 01:07 PM
  2. [SOLVED] Code working when using F8, but doesnt work properly through button click.
    By emilyloz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-01-2013, 09:58 AM
  3. Macro not running properly in Excel 2010
    By tony666 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-08-2011, 09:58 AM
  4. Private sub not working correctly when called from another macro
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-05-2008, 08:16 PM
  5. Macro not Running Properly in Excel 2003
    By Progress2007 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2008, 08:36 AM
  6. Command button not working properly on different sheet
    By Strikez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2007, 12:36 AM
  7. Replies: 3
    Last Post: 07-06-2006, 02:45 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