+ Reply to Thread
Results 1 to 5 of 5

nested loop for copying range: error no cells were found

  1. #1
    Registered User
    Join Date
    04-03-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    11

    nested loop for copying range: error no cells were found

    Labflow Lite.zip
    Hi,

    I have a problem with this code. Excel give the following error: error 1004: no cells were found.
    This sub should selected multiple ranges and look for blank cells in that range.
    Sheet11 is completely empty, so I do not understand why excel cannout found cells.

    Can anyone help me with this?

    The code is in module 10 and 11 (almost the same code just the range are different)


    Please Login or Register  to view this content.
    Thanks
    Last edited by Edejager; 04-09-2013 at 08:53 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: nested loop for copying range: error no cells were found

    Syntax error in the line Sheet2.Cells(i, "Q").Copy

    You need a numeric value where the Q is..
    Elegant Simplicity............. Not Always

  3. #3
    Registered User
    Join Date
    04-03-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: nested loop for copying range: error no cells were found

    Thanks,

    but where the Q is, is dependent on what is filled in the first sheet (and this can be anything text or numbers or both)
    So how can I write the code so that where the Q is, it can be anything. (but not only a numeric value)?
    Can you help me with this?

    Thanks

  4. #4
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: nested loop for copying range: error no cells were found

    But if you want to refer to a cell location using cells then you must use integer values to specify the location. Text won't work.

    You need to find a method of calculating which column you want the data to go into..

  5. #5
    Registered User
    Join Date
    04-03-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: nested loop for copying range: error no cells were found

    Okay, thanks!

    I will try this to makes its works

+ 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