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

    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
    Location
    Aberdeen, Scotland
    Posts
    1,067
    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.



    Code:
    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
    Dave

Posting Permissions

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