+ Reply to Thread
Results 1 to 12 of 12

Refining a Find Statement

  1. #1
    Registered User
    Join Date
    05-24-2010
    Location
    Rutherfordton, NC
    MS-Off Ver
    Excel 2007
    Posts
    39

    Question Refining a Find Statement

    I have part of a program which is creating a range based on the first x continuous cells that contain data. I currently am using a find statement, but it seems to slow down the program a lot. Is there a better way to either define a range, or to chose cells only until the last row of the worksheet? I have attached the section of code which I am currently using.
    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Refining a Find Statement

    Are you doing that once, or inside a loop?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Refining a Find Statement

    You don't say where you are searching, but this example will search just col A values.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-24-2010
    Location
    Rutherfordton, NC
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Refining a Find Statement

    Sorry. Inside a loop. Here is the full loop's code
    Please Login or Register  to view this content.
    Jordan Kidd

  5. #5
    Registered User
    Join Date
    05-24-2010
    Location
    Rutherfordton, NC
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Refining a Find Statement

    I am not really searching for anything particular. I just want to insert the mm/dd/yy all the way down the sheet until I get to the last row, which is indicated by column A. (last row is the one before beginning of blank rows)

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Refining a Find Statement

    Is there a better way to either define a range, or to chose cells only until the last row of the worksheet?
    That's the question you asked.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Refining a Find Statement

    I don't understand what you're doing at all. Maybe post a workbook and explain in context.

  8. #8
    Registered User
    Join Date
    05-24-2010
    Location
    Rutherfordton, NC
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Refining a Find Statement

    Sorry, I didn't mean the last row of the worksheet, I meant until the last row containing data. Do I really need to define range, or is there a better way to set how far the mm/dd/yy from the preceding code can be inserted to the specified cells?

  9. #9
    Registered User
    Join Date
    05-24-2010
    Location
    Rutherfordton, NC
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Refining a Find Statement

    The workbook which I am using is too big to upload. I have attached the code for the whole module. I hope we can make sense of this.

    Please Login or Register  to view this content.

  10. #10
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Refining a Find Statement

    You don't have to post your actual workbook. Add some dummy data, enough for us to understand what you are doing. This always helps.

  11. #11
    Registered User
    Join Date
    05-24-2010
    Location
    Rutherfordton, NC
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Refining a Find Statement

    I greatly appreciate it. I have attached one sheet which shows where the above code is running.
    Attached Files Attached Files

  12. #12
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Refining a Find Statement

    Still not sure what you're doing. Can you explain a bit more, or illustrate in your workbook? I can't really replicate your situation as you are using different workbooks. What should the worksheet you attached end up looking like?

+ 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