+ Reply to Thread
Results 1 to 12 of 12

Copy name of the Sheet into a Cell

  1. #1
    Registered User
    Join Date
    05-15-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    21

    Copy name of the Sheet into a Cell

    Hello All,

    I was wondering how I can copy the name of a sheet onto a cell on another sheet. The syntax is like this....
    With .Sheets(S)
    'Final 1
    FinalS1 = wsS.Cells(Rows.Count, 1).End(xlUp).Row

    wsS.Cells((FinalS1 + 1), 3).Value = "NEED THE NAME of .Sheets(S) here"

    End With

    Please help and thank you in advance!!
    Alexis

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

    Re: Copy name of the Sheet into a Cell

    Please Login or Register  to view this content.
    To mark your code as code just highlight it and click on the #
    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

  3. #3
    Registered User
    Join Date
    05-15-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Copy name of the Sheet into a Cell

    Wow that was really easy. But I actually need the name of the sheet that was given before not just the Sheet #. Can you help?

    Thanks!

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy name of the Sheet into a Cell

    I think most of the lines are wrong.
    May be

    Please Login or Register  to view this content.

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

    Re: Copy name of the Sheet into a Cell

    I thought that S was a string - can I see the preceding code where S is defined?

  6. #6
    Registered User
    Join Date
    05-15-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Copy name of the Sheet into a Cell

    Hmmm I actually dont think I defined S :/
    Its.....
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy name of the Sheet into a Cell

    May be then

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-15-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Copy name of the Sheet into a Cell

    I tried .Name and it didnt work. This is actually the code I am working with now - because I found that it was overwriting previously copied data with that other method. If there is a better method please let me know. I am basically trying to fill in the sheet wsS with the sheet "names".

    Please Login or Register  to view this content.
    Thank you!
    Alexis

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy name of the Sheet into a Cell

    This is how you read my code:
    exclude the sheet name summary from the loop, but for other sheets on the book, loop through and copy each sheet name in to next empty row of column C. Now, tell me what do you want to do and will adjust my code.

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

    Re: Copy name of the Sheet into a Cell

    Using your code:

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    05-15-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Copy name of the Sheet into a Cell

    Thanks so much both of you! Thats perfect!

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

    Re: Copy name of the Sheet into a Cell

    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)

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