+ Reply to Thread
Results 1 to 7 of 7

Cannot get wildcards to work

  1. #1
    Registered User
    Join Date
    11-17-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    69

    Cannot get wildcards to work

    I have attached a file with a VBA code that is supposed to loop through column "A" and color any cells that contain the word "Adjustments" in the text string within the cell. I have encased the word in wildcards (Asterisks) but the code will not work Need to have someone look at it to see if I have missed something out. Thank you in advance.

    Steve Davis.
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Cannot get wildcards to work

    Hi Steve,

    Try this:
    Please Login or Register  to view this content.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Cannot get wildcards to work

    Use Like instead of = in the If statement.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    11-17-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Cannot get wildcards to work

    Thanks a lot Marvin, really appreciate that, tell me though, was there a specific error in my code? Just would like to know out of interest.

  5. #5
    Registered User
    Join Date
    11-17-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Cannot get wildcards to work

    Thanks mate, I forgot all about "Like"! I have actually used it before but it was a long time ago.

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Cannot get wildcards to work

    Norie was correct. If you changed the = to Like the code worked fine.

  7. #7
    Registered User
    Join Date
    11-17-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Cannot get wildcards to work

    Thanks Marv, yes, I forgot all about "Like", I have used it previously but a very long time ago and completely forgot all about it!

+ 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. How can i make the wildcards work?
    By dan2010 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-22-2010, 08:20 AM
  2. Will Sumproduct work with wildcards?
    By jchambers00 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-07-2007, 03:28 PM
  3. [SOLVED] Cannot get Wildcards in Parameters to work in MS Query/Excel2003
    By Jan K in forum Excel General
    Replies: 3
    Last Post: 02-17-2006, 02:10 PM
  4. wildcards do not seem to work
    By Norman K via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-22-2005, 10:05 AM
  5. Wildcards in Advanced filter criteria don't work with Excel 2003
    By Inconceivable in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2005, 10:05 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