Getting Error in Application.WorksheetFunction

akhendre88

Board Regular
Joined
Sep 17, 2015
Messages
76
I am trying to use Application.WorksheetFunction
But getting an error "Object doesn't support this property or Method"
Below is my code
Code:
Sub test()
Dim a As String
Dim b As Long, c As Long

a = "This is testing"

c = Application.WorksheetFunction.Find("is", a)

MsgBox c

End Sub

Please suggest
 
Last edited:

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Re: Getting Errpr in Application.WorksheetFunction

Try
Code:
Sub test()
Dim a As String
Dim b As Long, c As Long

a = "This is testing"

c = InStr(a, "is")

MsgBox c

End Sub
 
Upvote 0
Re: Getting Errpr in Application.WorksheetFunction

Thank you for your reply.
But I would like to know how can I do this using WorksheetFunciton.
 
Upvote 0
Re: Getting Errpr in Application.WorksheetFunction

Your code works for me, so not sure why it's not working for you.
Also InStr is the VBA version the worksheetfunction.find, so is probably better to use.
 
Upvote 0
Re: Getting Errpr in Application.WorksheetFunction

Have a look at your find settings manually and see if it set up as match entire cell contents.
 
Upvote 0
Re: Getting Errpr in Application.WorksheetFunction

@MARK858
Range.Find is not the same as Application.Worksheetfunction.Find.
 
Upvote 0
Re: Getting Errpr in Application.WorksheetFunction

My bad... Not thinking
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,270
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top