+ Reply to Thread
Results 1 to 8 of 8

Cannot find asterisk signed cells

  1. #1
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,019

    Cannot find asterisk signed cells

    Hi people,
    Open an excel file, give a name first sheet as Sheet1.
    Enter "apple" into the A5 cell.
    Enter "*" into the A8 cell.
    Run this macro;
    Please Login or Register  to view this content.
    Then run this macro;
    Please Login or Register  to view this content.
    Why second macro above cannot find asterisk sign ?

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,199

    Re: Cannot find asterisk signed cells

    Hi, HerryMarkowitz,

    the asterisk is used as a wildcard - if you want to search for that character slightly alter the If-Statement:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485

    Re: Cannot find asterisk signed cells

    As the help on Like says

    'To match the special characters
    ' left bracket ([),
    ' question mark (?),
    ' number sign (#),
    ' and asterisk (*),
    ' enclose them in brackets. The right bracket (]) can't be used within a group to match itself, but it can be used outside a group as an individual character.
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,019

    Re: Cannot find asterisk signed cells

    You are perfect. Thank you.

  5. #5
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,019

    Re: Cannot find asterisk signed cells

    Hi again,
    Set any vlookup function in your Sheet1 cell,
    and,
    make sure that your vlookup function returns #N/A.

    Then, copy #N/A including cell and paste values.

    Run following code to find #N/A...
    Please Login or Register  to view this content.
    When you run the code above, you will see that code goes error...
    Any idea ?
    Last edited by HerryMarkowitz; 11-20-2013 at 09:12 PM.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485

    Re: Cannot find asterisk signed cells

    because for the cell with the formula these are the returned values when VLOOKUP returns #N/A error


    Please Login or Register  to view this content.

  7. #7
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,019

    Re: Cannot find asterisk signed cells

    Hi Andy Pope,
    I am not "immediate window" expert.
    Could you please explain with more detail ?

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485

    Re: Cannot find asterisk signed cells

    select cell with VLOOKUP formula
    goto VBE (ALT+F11)
    goto immediate window (CTRL+G)
    enter the following command and press Enter

    ?activecell.Value,activecell.text

    The result of Value is not #N/A but Error 2042. This is the reason your Like test false.

    You can either text value using ISERROR function. or use .Text property for Like comparison. Becareful if using the .text approach as that property contains what is actually displayed by the cell so can vary.

+ 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] Find and Replace an asterisk "*"
    By [email protected] in forum Excel General
    Replies: 2
    Last Post: 10-25-2013, 12:14 PM
  2. [SOLVED] Application.Match help. Find a match if first 4 numbers are the same. Asterisk not working
    By thelisa in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-24-2013, 08:01 AM
  3. [SOLVED] Working Age Group Signed From DOB and Date Signed
    By Bellio3105 in forum Excel General
    Replies: 2
    Last Post: 11-05-2012, 02:02 PM
  4. Find and replace asterisk
    By indimonk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2012, 05:30 AM
  5. Non-signed Difference between 2 cells
    By cherft in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-15-2005, 04:06 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