Results 1 to 2 of 2

Thread: Find method

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    1

    Find method

    Hello...

    i have written this as a piece of test code to find all the blanks in a worksheet... im well aware i can just loop through to find everything however... i want to use the find method...

    VB Code:
    1. Sub meh()
    2.     Dim R As Range, FindAddress As String
    3.     Sheets("REQUEST").Select
    4.     With ActiveSheet.Range("D34:D2004")
    5.         Set R = .Find("")
    6.         If Not R Is Nothing Then
    7.  
    8.             FindAddress = R.Address
    9.            
    10.             Do
    11.                  Set R = .FindNext(R)
    12.                  findagain = R.row
    13.                  MsgBox findagain
    14.                  
    15.             Loop While Not R Is Nothing And R.Address <> FindAddress
    16.         End If
    17.     End With
    18.  
    19.      'Clear memory
    20.     Set R = Nothing
    21.  
    22. End Sub

    nopw how di make this code return all the rows that ARE NOT blank.... thanks!

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178
    Try changing the line :-

    Code:
    Set R = .Find("*")
    Regards
    BrianB
    -------------------------------

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