CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2008
    Posts
    116

    Unhappy [Excel] Find & FindNext Method Problem

    Hi All,

    I am working with excel, and using this find/findnext method.
    Here is my code :

    Code:
    Excel.Range rgn;
    Excel.Range usedRange = workSheet.UsedRange;
    rgn = usedRange.Find("mystring", missing, missing, missing, missing, XlSearchDirection.xlNext, missing, missing, missing);
    
    And it seem okie. After that i used findNext method :
    
    rgn = usedRange.FindNext(rgn);
    
    but rgn is the same with last one. although there have many "mystring" in workSheet.
    
    I also had tried with this code :
    
    rgn = UsedRange.Find("myString", workSheet.Cells[startRow,startColumn], missing, missing, missing, XlSearchDirection.xlNext, missing, missing, missing);
    Thanks.
    Last edited by HanneSThEGreaT; June 21st, 2010 at 01:12 AM.
    My English is very bad. So tell me if Something I talked make u confuse.
    My Ebook Store: www.coding.vn/book.php

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: [Excel] Find & FindNext Method Problem

    zkidkid, please use [CODE] tags when posting code in future.

    As to your problem, have a look here :

    http://blogs.officezealot.com/hansen.../29/20211.aspx

  3. #3
    Join Date
    Oct 2008
    Posts
    116

    Re: [Excel] Find & FindNext Method Problem

    Hi,

    Thanks, I have worked around with google and find this above post.
    My way is the same with him, but it doesn't work.

    I am using Excel 2003.
    My English is very bad. So tell me if Something I talked make u confuse.
    My Ebook Store: www.coding.vn/book.php

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured