+ Reply to Thread
Results 1 to 7 of 7

Macro just stops without any error message

  1. #1
    Registered User
    Join Date
    04-24-2012
    Location
    Bloomington, IL
    MS-Off Ver
    Excel 2010
    Posts
    4

    Question Macro just stops without any error message

    Ok, this is my first post and I have to admit that I'm not very good at VBA but I can usually mess with things enough until I figure them out but this is one that I'm not having any luck with. A co-worker of mine actually created this macro and it runs fine. The only part that I added is the next to the last line - Sheets("building").Select

    But, when I add this line, it doesn't seem to run - the rest of the code runs but that part does not and, there is no error message - it just seems to treat that line like it is not even there. When I run just that line by itselft, it works fine. It just won't work as part of the larger macro. Any ideas what could be causing this?

    Thanks!
    Please Login or Register  to view this content.
    Last edited by Paul; 04-24-2012 at 05:43 PM. Reason: Added CODE tags for new user. Please do so yourself in the future.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro just stops without any error message

    Hi

    Is the 'building' sheet hidden?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    04-24-2012
    Location
    Bloomington, IL
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro just stops without any error message

    No, it's not hidden.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro just stops without any error message

    When you say it doesn't seem to run what do you see assuming you run the macro when 'building' isn't the active sheet? What do you expect to see.

    Are any columns or rows hidden? If so it's possible that the last cell selected is in the hidden row or column.

    Please upload your workbook so that we can see the problem in context.

  5. #5
    Registered User
    Join Date
    04-24-2012
    Location
    Bloomington, IL
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro just stops without any error message

    The macro is generally supposed to run from the "B.S.T." worksheet. When it's run, it should clear any of the selections that have been made on that worksheet which, it does, but that's where it stops when what I want it to do is simply select the "Building" worksheet. I actually want it to run another macro, once it's on that worksheet but I've removed that from the current code to try to simplify the problem b/c, the sticking point seems to be that it won't do anything after "Sheets("keyword").select". There are hidden rows and columns on this worksheet but the last cell that is selected is always "Keyword" which, is not hidden. I've uploaded the workbook.
    Attached Files Attached Files

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro just stops without any error message

    Hi,

    Your range 'keyword' is blank. Hence in your procedure 'MySearch' when your variable 'MyFind' = "" is encountered (after it's been set to the keyword value), the 'Then End' instruction is ending any more macro processing.

    Regards

  7. #7
    Forum Contributor
    Join Date
    04-03-2011
    Location
    India
    MS-Off Ver
    Excel 2015
    Posts
    122

    Re: Macro just stops without any error message

    Hi Kyle,

    Please confirm the keyword , Mysearch

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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