Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro - Find Function not working
When I used the FIND function in a macro I get an "Compile Error" function
not defined". It works fine when I use it in a cell in a worksheet. Is there a seperate Reference that needs to be added? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro - Find Function not working
Hi
If it is the worksheetfunction find you want to use, you have to use: WorksheetFunction.Find(...) If this does not help, post your code for further help. Regards, Per "Greg T" skrev i meddelelsen ... When I used the FIND function in a macro I get an "Compile Error" function not defined". It works fine when I use it in a cell in a worksheet. Is there a seperate Reference that needs to be added? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro - Find Function not working
Find means two different thing:
1. a function 2. a method In a worksheet cell: =FIND("happiness",A1) will look for "happiness" in A1 and return a number telling you where it begins. To do this in VBA, use: Sub dural() Dim A1 As Range Set A1 = Range("A1") x = Application.WorksheetFunction.Find("happiness", A1) End Sub -- Gary''s Student - gsnu200908 "Greg T" wrote: When I used the FIND function in a macro I get an "Compile Error" function not defined". It works fine when I use it in a cell in a worksheet. Is there a seperate Reference that needs to be added? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro - Find Function not working
If you're looking to find something in a string, then use VBA's built-in Instr()
function. No need to use application.find() or worksheetfunction.find(). Greg T wrote: When I used the FIND function in a macro I get an "Compile Error" function not defined". It works fine when I use it in a cell in a worksheet. Is there a seperate Reference that needs to be added? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find and Replace function not working | Excel Discussion (Misc queries) | |||
My Find and Replace function in Excel is not working? | Excel Worksheet Functions | |||
Find Function not working on protected sheet | Excel Worksheet Functions | |||
Help!!!!!! - Find Function not working from C# | Excel Programming | |||
VBA Excel/Access Find function (Ctrl+F) not working | Excel Programming |