+ Reply to Thread
Results 1 to 5 of 5

Built-in VBA search capabilities?

  1. #1
    Registered User
    Join Date
    08-10-2004
    Posts
    8

    Built-in VBA search capabilities?

    The (CTRL+F) search functionality in Excel will return a list of all cells (and their address) that contain the search string, if you select "Find All".

    Is there a VBA function or library that will allow me the same functionality programmatically? I had envisioned sending a search string to the library or function and have an array be passed back to the initializing routine...

    I am most interested in the cell addresses that contain the search string.
    Any ideas? Thanks.

    -Andrew

  2. #2
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    Hi Andrew,

    I know of no way to do this in a single line of code.

    But, you could use a Collection object to create a string of addresses. Something like this, maybe ...

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282
    Hi Andrew,

    Here's another way of getting what you need:
    Please Login or Register  to view this content.
    Hope this helps,
    theDude

  4. #4
    Registered User
    Join Date
    08-10-2004
    Posts
    8

    It works, now a twist...

    Thanks theDude! The functionality of this coding worked very well... now, I am trying to find a way to do the same type of search, but in a different unopenned spreadsheet. Different approach all together or could I tweak your previous code example?

  5. #5
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282
    Hi Andrew,

    My code won't run on an unopened file, but you can add this:
    Please Login or Register  to view this content.
    after the search term prompt:
    Please Login or Register  to view this content.
    Hope this helps,
    theDude

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1