+ Reply to Thread
Results 1 to 7 of 7

Autofilter number with wildcard return blank value

  1. #1
    Forum Contributor
    Join Date
    02-01-2013
    Location
    Oslo
    MS-Off Ver
    Excel 2010
    Posts
    163

    Autofilter number with wildcard return blank value

    Hi,

    I have below code to seach my data in another sheet. It works fine when the search is for the column containing text but when I am using the same code to the column containing only number, this returns me blank value and search for nothing. Is there anything wrong here? Please help.
    Example number 1122334455 where I allow search with a part of number e.g. *2233*

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Autofilter number with wildcard return blank value

    It is because the search criteria takes a string, not a number. You can convert the number in to a string.

    Mynumber= cstr(ThisWorkbook.Sheets("Sheet1").Range("M15").Value) and
    use this Mynumber as a criteria.

  3. #3
    Forum Contributor
    Join Date
    02-01-2013
    Location
    Oslo
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: Autofilter number with wildcard return blank value

    HI AB33,

    Thank you for your reply. I have set Mynumber as you said, still I get the same result.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Autofilter number with wildcard return blank value

    Sorry! I was meant to be the search column. You have a search item as a string, but the searched column is still a number.
    I normally format the search column as a text first, then filter and convert back the column in to numbers.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Autofilter number with wildcard return blank value

    That's not the way.
    You will need to convert the value in column to str and back.
    try
    Please Login or Register  to view this content.
    Edit: Formula inside Evaluate method.

    AdvancedFilter
    Please Login or Register  to view this content.
    Last edited by jindon; 12-08-2017 at 07:04 AM.

  6. #6
    Forum Contributor
    Join Date
    02-01-2013
    Location
    Oslo
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: Autofilter number with wildcard return blank value

    Hi jindon,

    This work so great. Thank you very much

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Autofilter number with wildcard return blank value

    You are welcome and thanks for the rep.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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] Is there a way to return either a number or a blank cell?
    By mumair in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-21-2017, 12:35 PM
  2. Autofilter integer and wildcard
    By crusno in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2015, 03:56 PM
  3. Find Wildcard, return that Wildcard value?
    By help_me_im_lost in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-08-2014, 01:20 PM
  4. Macro with autofilter with an array to remove unwanted criteria with wildcard
    By newmania2008 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-28-2014, 05:50 PM
  5. [SOLVED] Autofilter, criteria from InputBox and Wildcard
    By gvaltat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-18-2014, 01:33 PM
  6. [SOLVED] Return row number of blank row
    By straubj in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-30-2013, 02:13 AM
  7. Replies: 5
    Last Post: 03-12-2010, 07:33 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