+ Reply to Thread
Results 1 to 5 of 5

Run-time error. No cells were found

  1. #1
    Forum Contributor
    Join Date
    05-07-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    215

    Run-time error. No cells were found

    Hello All. In one of my macros I have a code that searches for empty cells and if the cell is empty it enters the value from a text box. The problem I am having is if there are no empty cells I get a run time error for "no cells were found"
    How do I make it not error if there are no blank cells? The code I am using is below.

    Please Login or Register  to view this content.

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

    Re: Run-time error. No cells were found

    Use
    Please Login or Register  to view this content.
    before and
    Please Login or Register  to view this content.
    after the failing line of code.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    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 Contributor
    Join Date
    01-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    227

    Re: Run-time error. No cells were found

    Try adding on error resume next above that code line.
    If I've been of help, plz add reputation.

  4. #4
    Forum Contributor
    Join Date
    05-07-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    215

    Re: Run-time error. No cells were found

    Thanks guys!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,650

    Re: Run-time error. No cells were found

    You're welcome. Thanks for the rep.

+ 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. [SOLVED] run time error 1004 no cells were found
    By iwannabakat in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2014, 04:13 PM
  2. [SOLVED] Alternative message box instead of run time error 1004 box no cells were found
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-05-2013, 04:26 AM
  3. [SOLVED] Run Time Error Message 1004 : No Cells were found
    By brajpalshishodia in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-15-2012, 12:52 PM
  4. Run-time error '1004': No cells were found
    By tirk82 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2012, 12:48 PM
  5. [SOLVED] Run-time error '1004': No cells were found
    By Jamie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2005, 06:06 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