+ Reply to Thread
Results 1 to 3 of 3

Sheet name according to file name..!!!

Hybrid View

  1. #1
    Forum Contributor meus's Avatar
    Join Date
    11-25-2014
    Location
    kathmandu
    MS-Off Ver
    2010/ 2013
    Posts
    287

    Sheet name according to file name..!!!

    Hi friends!!
    I am wondering if someone could help me on building a macro whose "Sheet1" name would rename/ change according to it's file name...
    Like if i have a file name MEUS, then when i run the macro, my first sheet i.e sheet1 or having any other name should change to the name "MEUS"..
    Thanks...

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Sheet name according to file name..!!!

    You may try this:

    Sub RenameSheet()
        Dim s
        s = ActiveWorkbook.Name
        If InStr(1, s, ".xls", vbTextCompare) > 0 Then s = Left(s, InStrRev(s, ".") - 1)
        s = Left(s, 31)
        ActiveSheet.Name = s
    End Sub
    多么想要告诉你 我好喜欢你

  3. #3
    Forum Contributor meus's Avatar
    Join Date
    11-25-2014
    Location
    kathmandu
    MS-Off Ver
    2010/ 2013
    Posts
    287

    Re: Sheet name according to file name..!!!

    Thanx millz...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Find a cell in one file.sheet and bring it into another file.sheet
    By fred3 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-27-2014, 01:56 PM
  2. Replies: 0
    Last Post: 01-21-2014, 10:52 AM
  3. Copy / Paste Values Only one sheet into another file from a multi sheet excel file
    By srisri201012 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-27-2013, 12:56 PM
  4. Replies: 5
    Last Post: 01-09-2013, 04:06 AM
  5. Sheet A in file X to Sheet B in file Y when both files are opened by excel.
    By sunheroj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2012, 09:52 AM

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