PDA

View Full Version : Solved: .Find for empty string



TheAntiGates
10-10-2007, 08:01 AM
I have a complete and working routine using .Find that looks in xlComments. I'd like it to find *any* comment regardless of content. Using "" as the search string fails to match. (BTW, I msgbox on each hit, so Go To Special Comments is NFG.)

Set c = .Find(what:=sSearchText, LookIn:=xlComments, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
After:=ActiveCell.SpecialCells(xlLastCell), MatchCase:=False)

Right now the best I've come up with is " " (space). That's obviously imperfect. Got anything better? XL97,03

Norie
10-10-2007, 08:06 AM
(BTW, I msgbox on each hit, so Go To Special Comments is NFG.)
Why not?

You could use that method to return a range with all the comments.

Then loop throught that range cell by cell.

Or is there more too it?:bug:

TheAntiGates
10-10-2007, 08:30 AM
Okay, that sounds good. Sharp thinking.