+ Reply to Thread
Results 1 to 7 of 7

Refering to Sheet

  1. #1
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Refering to Sheet

    I'm trying to have the macro refer to the active Tab/Sheet name within a workbook. Not the workbook name- but the following code is refering to the workbook name. What would I substitute activesheet for to refer to the tab?

    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: Refering to Sheet

    This one returns sheet name, not workbook name

    Please Login or Register  to view this content.

  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: Refering to Sheet

    There's nothing in that code that refers to a workbook, ActiveSheet.Name will return the name of the active sheet.
    If posting code please use code tags, see here.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Refering to Sheet

    it looks like something is wrong - unless you typed this code into the post:

    Please Login or Register  to view this content.
    The VBE would have made it become:

    Please Login or Register  to view this content.
    Otherwise that code should have worked with the tab name not the book name???
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  5. #5
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Refering to Sheet

    Good eye xladept. I had activeworksheet that I was trying when I thought activesheet wasn't working and then I deleted it in the post- explaining the missing capitals. I actually was brainfarting and need to use Right(activesheet.name). That's why I didn't think it was working. Thanks for your help.

  6. #6
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Refering to Sheet

    Good eye xladept. I had activeworksheet that I was trying when I thought activesheet wasn't working and then I deleted it in the post- explaining the missing capitals. I actually was brainfarting and need to use Right(activesheet.name). That's why I didn't think it was working. Thanks for your help.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Refering to Sheet

    Hmmm - flatulence of the brain You're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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