What is SearchFormat parameter in cell.Find / Range.Find do?

R

Rick Rothstein

You would use it in conjunction with the FindFormat property of the
Application object. It allows you do restrict your search to specific format
conditions. For example, do the following... type ABC in A1 on Sheet1 and
copy it down for, say, twenty cells, and then copy those all across for 3
columns; then make the ABC entry in B10 Bold. Now run this code... it will
find the cell with the bold ABC in it, ignoring all the other ones
surrounding it, and display its address.

Sub Test()
Application.FindFormat.Font.FontStyle = "Bold"
MsgBox Cells.Find(What:="*", SearchFormat:=True).Address
End Sub
 
A

Alex

Thank you, Rick.

I'm actually trying to find date. For example, column A contain dates from
Jan 20 2009 till Jan 25 2009. Depending on the computer (Windows settings /
Excel settings), dates will be formated differrenly: 2009-01-20 or 1/20/2009
or........ Date from the database comes in 2009-01-20 format. I need to find
date from the database in the column A.
Can I use Application.FindFormat for that? NumberFormat?
Another question, how I can get this date setting from Excel? (I can
convert database's date format to Excel's).

Thank you very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top