+ Reply to Thread
Results 1 to 3 of 3

Macro works via step through but does not on button click

  1. #1
    Registered User
    Join Date
    04-23-2017
    Location
    Poland
    MS-Off Ver
    2016
    Posts
    4

    Macro works via step through but does not on button click

    Hello,

    i have created the macro below, what it does, it copies data from 2 Sheets into one to compile it and then copies it into the 3rd one called database. The problem is, if I manually click through every step it does everything correctly but if i use the button, only the first "IF" works, the rest skips to "Else" for some reason even though it should not. Do you see any reason for that?

    Please Login or Register  to view this content.
    Last edited by Arsen258; 05-13-2020 at 08:42 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    31,099

    Re: Macro works via step through but does not on button click

    Do you see any reason for that?
    Not without the data. See the yellow banner at the top of the page.
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: 2019 but still use also older versions
    Posts
    7,472

    Re: Macro works via step through but does not on button click

    Hi,

    As Trevor said - not seeing data it's not easy.

    The only immediately suspicious element of the code is: you chceck systematically just
    Please Login or Register  to view this content.
    ,

    May be the active sheet is not the one you think is active - so it would be wise to use fully qualified address (at least with sheet reference), so
    Please Login or Register  to view this content.
    etc.
    Best Regards,

    Kaper

+ 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 only works step-by-step
    By smw10c in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-31-2020, 10:41 AM
  2. Macro errors when running, but works when done step by step
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-02-2018, 03:54 PM
  3. [SOLVED] MAcro works OK in Step into debug mode but not doing job when run from command button
    By caabdul in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-10-2018, 10:16 AM
  4. Single step works fine but command button has errors
    By CptCrunch51 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2017, 01:07 PM
  5. VBA Code works by step by step, doesn't work by running
    By lucasar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2016, 06:33 AM
  6. [SOLVED] Macro works in step through but not when run
    By bruizer31 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2013, 05:50 PM
  7. Macro works and loops perfectly in VBA but does not loop on button click
    By evan.sams in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-25-2012, 08:25 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