+ Reply to Thread
Results 1 to 4 of 4

Checking for text in Sheet Name

  1. #1
    Barb Reinhardt
    Guest

    Checking for text in Sheet Name

    I am wanting to check for a specific grouping of text in the sheet name using
    something similar to the SEARCH function. Let's say, for example, I want to
    find if "1" is present in the sheet name. How would I code that?

    Thanks,
    Barb Reinhardt

  2. #2
    Die_Another_Day
    Guest

    Re: Checking for text in Sheet Name

    If InStr(1,ActiveSheet.Name,"1") > 0 Then
    '1 is in the name
    Else
    '1 is not in the name
    End If

    HTH

    Die_Another_Day

    Barb Reinhardt wrote:
    > I am wanting to check for a specific grouping of text in the sheet name using
    > something similar to the SEARCH function. Let's say, for example, I want to
    > find if "1" is present in the sheet name. How would I code that?
    >
    > Thanks,
    > Barb Reinhardt



  3. #3
    Dave Peterson
    Guest

    Re: Checking for text in Sheet Name

    Check out VBA's InStr().



    Barb Reinhardt wrote:
    >
    > I am wanting to check for a specific grouping of text in the sheet name using
    > something similar to the SEARCH function. Let's say, for example, I want to
    > find if "1" is present in the sheet name. How would I code that?
    >
    > Thanks,
    > Barb Reinhardt


    --

    Dave Peterson

  4. #4
    Stefi
    Guest

    RE: Checking for text in Sheet Name

    Hi Barb,

    x = InStr(1, ActiveSheet.Name, "1")
    gives you the place of "1" in sheet name or 0 if "1" is not present.

    Regards,
    Stefi

    „Barb Reinhardt” ezt *rta:

    > I am wanting to check for a specific grouping of text in the sheet name using
    > something similar to the SEARCH function. Let's say, for example, I want to
    > find if "1" is present in the sheet name. How would I code that?
    >
    > Thanks,
    > Barb Reinhardt


+ 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