+ Reply to Thread
Results 1 to 6 of 6

Alternative message box instead of run time error 1004 box no cells were found

  1. #1
    Forum Contributor
    Join Date
    04-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    329

    Alternative message box instead of run time error 1004 box no cells were found

    Hi all,

    I have a button with an assigned macro that clears certain groups of cells but if the button is pressed unnecessarily & the cells are already blank it returns "run time error 1004 box no cells were found". Is there a way of returning a message box with "No Cells Found" & press "OK" to continue instead?
    Thank you all & have a great day

    Marco

  2. #2
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Alternative message box instead of run time error 1004 box no cells were found

    Not sure what your code looks like but you can add this at the top:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Alternative message box instead of run time error 1004 box no cells were found

    Or you can do:
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    04-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    329

    Re: Alternative message box instead of run time error 1004 box no cells were found

    Thank you stojko89, your last code works a treat, have a great day :-)

  5. #5
    Registered User
    Join Date
    06-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Alternative message box instead of run time error 1004 box no cells were found

    Hello,

    New to VB and forums...I am having the same issue as above. How do I get a message box to appear instead of the run time 1004 error. My code is attached to a button to clear all entries on a worksheet and I am not sure where to go from here.

    Any help would be appreciated.


    Please Login or Register  to view this content.
    Last edited by arlu1201; 08-05-2013 at 04:24 AM.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Alternative message box instead of run time error 1004 box no cells were found

    ap6,

    Welcome to the forum. 2 pointers -

    1. I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. In order to put code tags, either type [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] at the end of it, OR you can highlight your code and click the # icon at the top of your post window.

    2. Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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