Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: Application.WorksheetFunction.find

    I am trying to find a char in a cell using :

    Sub findReplace()
    Dim sfind As String
    Dim sreplace As String
    Dim i As Integer
    Dim d As Double
    sfind = ActiveCell.Value

    d = Application.WorksheetFunction.Find(Range(ActiveCel l.Address), ".")
    sfind = Trim(Right(ActiveCell.Value, d))
    sfind = InputBox("Search on ", , sfind)

    End Sub

    I keep getting runtime error 1004
    unable to get the find property of the worksheetfunction class

  2. #2
    Join Date
    Jan 2004
    Aberdeen, Scotland
    Try using the instr/instrrev function in place of the worksheet function.

    I think this is the sort of thing you are trying to do.

    Sub FindInCell()
        Dim sFind As String
        Dim iFind As Integer
        sFind = ActiveCell.Value
        iFind = InStrRev(sFind, ".")
        sFind = Trim(Right(sFind, iFind + 1))
        MsgBox sFind
    End Sub
    All the best

Posting Permissions

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