+ Reply to Thread
Results 1 to 8 of 8

If Worksheet like (*Comments*) exists do the following. Use of wildcards in Function

  1. #1
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    142

    Question If Worksheet like (*Comments*) exists do the following. Use of wildcards in Function

    Hi All.

    I have a very useful function that I have found online:
    Please Login or Register  to view this content.
    The above function works great - What it doesn't do is allow the use of a wildcard in the sheet name to search for.

    What I would like is a modification to the above function or code to allow me to use a wildcard to search for sheets
    Please Login or Register  to view this content.
    Any help appreciated as always.
    Cheers,
    Mark
    Last edited by R_S_6; 10-14-2010 at 05:04 AM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: If Worksheet like (*Comments*) exists do the following. Use of wildcards in Funct

    This is one way with a different approach:

    Please Login or Register  to view this content.

    Dom
    Last edited by Domski; 10-07-2010 at 09:10 AM.
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: If Worksheet like (*Comments*) exists do the following. Use of wildcards in Funct

    You could use something like:
    Please Login or Register  to view this content.
    called as either:
    Please Login or Register  to view this content.
    for exact match or:
    Please Login or Register  to view this content.
    for partial match.

    If you want specific combinations of wildcards, then you could use Like instead.
    Remember what the dormouse said
    Feed your head

  4. #4
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    142

    Question Re: If Worksheet like (*Comments*) exists do the following. Use of wildcards in Funct

    Thank you both for your help.

    I have utilised Dom's solution as I had to get it going ASAP.

    I am interested romperstoper how you would utilise the 'Like' coding in your example for combos of wildcards???

    Lastly i'm using this code in the following:
    Please Login or Register  to view this content.
    'Cancel = False' allows the workbook to close. Is there a way I can add to this line to allow it to save without the user input of 'Yes' 'No' 'Cancel'?? a bit like how you would use:
    Please Login or Register  to view this content.
    Thanks in advance!
    Mark

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: If Worksheet like (*Comments*) exists do the following. Use of wildcards in Funct

    Please Login or Register  to view this content.

    Dom

  6. #6
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    142

    Talking Re: If Worksheet like (*Comments*) exists do the following. Use of wildcards in Funct

    Cheers Dom,

    Nice One!

  7. #7
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: If Worksheet like (*Comments*) exists do the following. Use of wildcards in Funct

    Untested, but something like:
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    142

    Re: If Worksheet like (*Comments*) exists do the following. Use of wildcards in Funct

    Thanks for that Romperstomper - I'll give it a go ;-)

+ 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