+ Reply to Thread
Results 1 to 5 of 5

Avoiding Run Time Error

  1. #1
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Avoiding Run Time Error

    Hello,

    I currently have a spread sheet where the user enters 'y' in the G column. If a y is entered, the user can then press the 'Update' button, and the rows containing a y in the g column will be moved to a different sheet, 'History'.

    It works fine if there are y's entered into the column, but I want to be able to avoid the user getting: "Run-Time Error '1004': no cells were found" when no y's are entered into the g column.

    The current code is this:
    Please Login or Register  to view this content.
    I have attached my work book. The following code is for Current Contractors and History Contractors, although almost the exact code is being used for Maintenance Sheets.

    Please Help
    Attached Files Attached Files

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Avoiding Run Time Error

    perhaps change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Avoiding Run Time Error

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Avoiding Run Time Error

    Put these lines at the top (before the ScreenUpdating line):

    Please Login or Register  to view this content.
    Gary's Student

  5. #5
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: Avoiding Run Time Error

    Thank you All!

    JosephP, I used your suggestion because it required the least amount of change!

+ 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