View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
yogendra joshi yogendra joshi is offline
external usenet poster
 
Posts: 48
Default Using Worksheet Function Find in VBA

Try this

Sub test()
If ActiveCell.Value Like "*,*" Then MsgBox "Contains "","""
End Sub


bcmiller < wrote:

I am trying to use the worksheetfunction find to establish whether a
text string contains a comma or not (refer below)

testComma = WorksheetFunction.Find(",", ResultsValue, 1)

I have also tried

testComma = iserror(WorksheetFunction.Find(",", ResultsValue, 1))

However, if the string does not contain a comma I get a run-time error
1004

Unable to get Find propert of WorksheetFunction class.

Any tips would be appreciated.


---
Message posted from http://www.ExcelForum.com/