Results 1 to 4 of 4

Thread: &[TAB] (2k2SP2)

  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    Georgetown, Grand Cayman, Cayman Islands
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    &[TAB] (2k2SP2)

    I know that the "code" in the subject works for inserting the name of the worksheet in the header or footer, but I'd like to put the name of the worksheet ON the worksheet itself. I couldnt find a function that returns the name of it in the list when I selected Insert>function menu and the help file wasn't very on the subject [img]/forums/images/smilies/smile.gif[/img]

    Is what im doing even possible? Seems like it should be easy, but I cant find any references to it [img]/forums/images/smilies/smile.gif[/img]

    Thanks in advance
    Mark

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: &[TAB] (2k2SP2)

    The User Defined Function below will do this:

    <pre>Public Function SheetName() As String
    Application.Volatile
    SheetName = ActiveSheet.Name
    End Function
    </pre>

    Legare Coleman

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: &[TAB] (2k2SP2)

    You want the CELL function. Unfortunately, the CELL function is like Ragu, "It's all in there," so parsing out what you need is painful. This should do what you want:
    <pre>=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,1000)</pre>

    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  4. #4
    Star Lounger
    Join Date
    Feb 2001
    Location
    Georgetown, Grand Cayman, Cayman Islands
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: &[TAB] (2k2SP2)

    Ha! what a great analogy, SammyB [img]/forums/images/smilies/smile.gif[/img] Thanks though, it worked. I assume I can fiddle with the MID functions to get a PARTIAL tab name, too? [img]/forums/images/smilies/smile.gif[/img]

    Many Thanks
    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •