Consulting

Results 1 to 3 of 3

Thread: Solved: .Find for empty string

  1. #1
    VBAX Tutor TheAntiGates's Avatar
    Joined
    Feb 2005
    Location
    Tejas
    Posts
    263
    Location

    Solved: .Find for empty string

    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
    I just found a cool semi-advanced VBA page - dictionary, queue, etc. http://analystcave.com/excel-vba-dic...ta-structures/

  2. #2
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Quote Originally Posted by TheAntiGates
    (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?

  3. #3
    VBAX Tutor TheAntiGates's Avatar
    Joined
    Feb 2005
    Location
    Tejas
    Posts
    263
    Location
    Okay, that sounds good. Sharp thinking.
    I just found a cool semi-advanced VBA page - dictionary, queue, etc. http://analystcave.com/excel-vba-dic...ta-structures/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •