Current state of find

JoeMajestee

New Member
Joined
Jul 15, 2009
Messages
49
Hello,

Maybe someone here can help. I would like to get the current state of the find thingy (method?), use it looking at xlWhole, then return it to whatever it was before.
Code:
Public Function CheckTopRowFor(strHeader As String) As Integer
Set rng = Rows(1).Find(what:=strHeader, Lookat:=xlWhole)
If rng Is Nothing Then CheckTopRowFor = 0 Else CheckTopRowFor = rng.Column
End Function

Thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Although Excel stores the setting for LookAt, I don't think it's exposed as a property. The only thing I can think of is to add a temporary sheet before you start, put some text in A1, and search for part of it. If it's found the setting is xlPart; if not it's xlWhole.
 
Upvote 0
Well that's sort of a drag. 'Glad I didn't try too hard to get this. It's almost always xlpart, so maybe I'll just add a dummy search at the end that sets it to xlpart.

Thanks Andrew.
 
Upvote 0

Forum statistics

Threads
1,224,525
Messages
6,179,319
Members
452,905
Latest member
deadwings

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