+ Reply to Thread
Results 1 to 5 of 5

Search parameters to find inside formulas

  1. #1
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241

    Search parameters to find inside formulas

    I use this line to search for a chain or a digit in the sheet
    Please Login or Register  to view this content.
    and it works fine; but in cells with formulas it doesn't search inside the formula; only in the total value.
    Which parameter must I change so it will search also inside the formula?
    I've tried xlFormulas in place of xlValues; but then it searches only inside formulas skipping other cells

    Thanks for any help
    Last edited by aca; 02-21-2024 at 08:26 AM.

  2. #2
    Registered User
    Join Date
    12-07-2023
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    10

    Re: Search parameters to find inside formulas

    Can you give an example of what you are trying to achieve?

    As an idea, you can combine the searches: try to search in values, and then in formulas. If any of the results returns a range, you can then activate this range.

    Something like this:

    Please Login or Register  to view this content.
    Last edited by rpieuhtyelnekpmduz; 02-21-2024 at 10:08 AM.

  3. #3
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241

    Re: Search parameters to find inside formulas

    Thank you for this contribution
    What I try to achieve? Just to be brought to the cells containing the word or the numbers for a variety of purposes: copy them, replace, delete them etc.
    Your suggestion of using the two kinds of searching, one after the other is certainly very useful if one and the same cannot look both at the cell and inside the formulas. Thank you for that.
    aca

  4. #4
    Registered User
    Join Date
    12-07-2023
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    10

    Re: Search parameters to find inside formulas

    Ah, ok.

    It actually appears that you can search in both formulas and values at the same time. Just omit the LookIn parameter in your code:
    Before
    Please Login or Register  to view this content.
    After
    Please Login or Register  to view this content.


    If your ranges are located next to each other, you can combine them using Union method in VBA. Otherwise I guess you will need to copy (or perform whichever action you need) in a loop.
    Please review the following code sample. It highlights all cells where either formula or text contain valueToSearch.

    Please Login or Register  to view this content.
    Last edited by rpieuhtyelnekpmduz; 02-22-2024 at 08:30 AM.

  5. #5
    Forum Contributor
    Join Date
    08-04-2005
    Location
    Madrid, Spain
    MS-Off Ver
    2010
    Posts
    241

    Re: Search parameters to find inside formulas

    Thank you very, very much: that works worderfully. Exactly what I needed.
    I add to your reputation with enormous pleasure.
    aca
    I'd like to mark this post "Solved" but I don't know how to do that.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA find and replace inside array formulas? Possible?
    By phpolicylady in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2015, 12:52 PM
  2. Get parameters inside Randbetween
    By mat 1_8 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-13-2014, 03:21 PM
  3. [SOLVED] Find and Replace for Inside Formulas
    By VICEROY in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-13-2013, 01:03 AM
  4. Finding data inside an Excel Table using two parameters of search
    By drsteffa in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-04-2012, 08:54 AM
  5. [SOLVED] Macro ignores search code when 1 of the 2 search parameters is not found
    By BrodyNoochie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-25-2012, 05:21 PM
  6. Search a range to find cells containing formulas
    By tanktata in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-07-2006, 11:41 AM
  7. Replies: 1
    Last Post: 01-31-2006, 06:25 PM

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