Results 1 to 9 of 9

.find Function Failing

Threaded View

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2010
    Posts
    52

    .find Function Failing

    Excel Forum,

    I am searching for the row number of a cell in column A that contains a specific value. My code is returning errors and after researching the issue I am still at a loss. I have tried cutting and pasting other programmers' code into my worksheet but that still fails. Any help will be greatly appreciated.

    Below is my code and attached is the spreadsheet I am searching in. The portion that is failing me is in bold.

    Thank you for your help.


      
    With Sheets("12 mo inc det")
            .Select
            .Unprotect
            Columns("A:B").EntireColumn.Hidden = False
                Range("ah12").Value = "1"
                Range("ah12").Copy
                    Columns("a:a").PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply
                Range("ah13").Select
                
            Dim keyRange As Range, keyRow As Range
                Set keyRange = Range("a1", Range("a65536").End(xlUp))
                Set keyRow = keyRange.Find(what:="4010", LookIn:=xlValues, lookat:=xlPart)
                    If keyRow Is Nothing Then
                        MsgBox "not found"
                    Else
                        MsgBox "found on row " & keyRow.Row
                    End If
                             
            
        End With
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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