ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   changing the constants in the find function (https://www.excelbanter.com/excel-programming/303028-changing-constants-find-function.html)

OkieViking

changing the constants in the find function
 
I am writing a program using the find function in VBA. I would like for the user to be able to chose whether to look in values or formulas (LookIn:=xlValue or xlFormula). When I set a variable = to "xlValue" or xlFormula I get an error message in the find formula. How do you let the user control the LookIn value?

Juan Pablo González

changing the constants in the find function
 
xlValues and xlFormulas are actually numbers, constants, not strings. They
belong to the xlFindLookIn enumeration, and their actual values a

?xlFindLookIn.xlValues, xlFindLookIn.xlFormulas
-4163 -4123

--
Regards

Juan Pablo González

"OkieViking" wrote in message
...
I am writing a program using the find function in VBA. I would like for

the user to be able to chose whether to look in values or formulas
(LookIn:=xlValue or xlFormula). When I set a variable = to "xlValue" or
xlFormula I get an error message in the find formula. How do you let the
user control the LookIn value?



Ron de Bruin

changing the constants in the find function
 
You can find the numbers like this

Alt-F11
Ctrl-G to display the Immediate window

Enter this and press Enter
? xlFormulas

You get the number -4123

Or Juan his example

?xlFindLookIn.xlValues, xlFindLookIn.xlFormulas
-4163 -4123


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Juan Pablo González" wrote in message ...
xlValues and xlFormulas are actually numbers, constants, not strings. They
belong to the xlFindLookIn enumeration, and their actual values a

?xlFindLookIn.xlValues, xlFindLookIn.xlFormulas
-4163 -4123

--
Regards

Juan Pablo González

"OkieViking" wrote in message
...
I am writing a program using the find function in VBA. I would like for

the user to be able to chose whether to look in values or formulas
(LookIn:=xlValue or xlFormula). When I set a variable = to "xlValue" or
xlFormula I get an error message in the find formula. How do you let the
user control the LookIn value?






All times are GMT +1. The time now is 03:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com