+ Reply to Thread
Results 1 to 3 of 3

Findnext not working

Hybrid View

Guest Findnext not working 11-16-2006, 04:35 PM
mudraker It looks like you are not... 11-16-2006, 07:41 PM
Guest Yup. that was it. Thanks. 11-16-2006, 10:08 PM
  1. #1
    bjwade62
    Guest

    Unhappy Findnext not working

    I can't seem to get the findnext to work. I can find the first instance but none after that. Here's my code. Can anyone help me? Thanks.

        Dim B As Range
        Dim SheetNumb As Integer
        SheetNumb = 1
        Do While SheetNumb <= Sheets.Count
            Sheets(SheetNumb).Select
            If ActiveSheet.Name = "Page1" Then
                Exit Do
            End If
            Set B = Sheets(SheetNumb).Cells.Find("Mechanical", SearchOrder:=xlByColumns, LookIn:=xlValues)
            If Not B Is Nothing Then
                B.Activate
                FindAddress = B.Address
                Do
                    B = Sheets(SheetNumb).Cells.FindNext(B)
                Loop While Not B Is Nothing And B.Address <> FindAddress
            End If
            SheetNumb = SheetNumb + 1
        Loop

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    It looks like you are not setting B in you Do Loop

    try changing

    B = Sheets(SheetNumb).Cells.FindNext(B)

    to

    Set B = Sheets(SheetNumb).Cells.FindNext(B)

  3. #3
    bjwade62
    Guest
    Yup. that was it. Thanks.

+ 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