If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Application.WorksheetFunction.find

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-20-05, 15:54
mikezcg mikezcg is offline
Registered User
 
Join Date: Oct 2003
Posts: 311
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
Reply With Quote
  #2 (permalink)  
Old 09-21-05, 09:02
DavidCoutts DavidCoutts is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On