ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find/search function/example request. (https://www.excelbanter.com/excel-programming/275363-find-search-function-example-request.html)

Aaron[_8_]

Find/search function/example request.
 
Does anyone have an example of finding information in excel and reading the
information into VB or VBA (preferably VB)?

Thanks,
Aaron



Tom Ogilvy

Find/search function/example request.
 
here is the help example for using the find method of the range object in
Excel:

With Worksheets(1).Range("a1:a500")
Set c = .Find(2, lookin:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.Pattern = xlPatternGray50
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End WithFind has many more arguments. You can see and example of them by
turning on the macro recorder (tools=Macros=record a new macro) and then
doing a find manual (Edit=Find)-- Regards,Tom Ogilvy"Aaron" <NONE wrote in
message ...
Does anyone have an example of finding information in excel and reading

the
information into VB or VBA (preferably VB)?

Thanks,
Aaron






All times are GMT +1. The time now is 02:13 PM.

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