+ Reply to Thread
Results 1 to 4 of 4

A unknow find error...

Hybrid View

  1. #1
    Registered User
    Join Date
    07-05-2006
    Posts
    16
    Quote Originally Posted by davesexcel
    lets see more of the code
    Well while this is failing in a much longer macro, it is also failing in the following "test" macro.

    Sub test()
    Dim intRow As Integer


    If Not Worksheets("Joy 2006").Range(Cells(7, 7), Cells(57, 7)).Find("Complete") Is Nothing Then
    intRow = Worksheets("Joy 2006").Range(Cells(7, 7), Cells(57, 7)).Find("Complete").Row
    End If
    MsgBox (intRow)

    Worksheets("Joy 2006").Range(Cells(7, 7), Cells(41, 7)).Select
    End Sub

  2. #2
    Registered User
    Join Date
    07-05-2006
    Posts
    16
    Ok I've sorted this out. The problem only occured when the active sheet was not "Joy 2006" so I changed the code to the following and now it works:

    Sub test()
    Dim intRow As Integer


    If Not Worksheets("Joy 2006").Range(Worksheets("Joy 2006").Cells(7, 7), Worksheets("Joy 2006").Cells(55, 7)).Find("Complete") Is Nothing Then
    intRow = Worksheets("Joy 2006").Range(Worksheets("Joy 2006").Cells(7, 7), Worksheets("Joy 2006").Cells(57, 7)).Find("Complete").Row
    End If
    MsgBox (intRow)

    End Sub

+ 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