BInterest

Blog of Ur Interest

VBA Macro – Auto Rename Excel Worksheet Code


How to auto rename excel worksheet tabs to specific cell via VBA code or macro ? There is not official way / ribbon button / function to auto rename all the tabs in excel workbook as per contain of specified cell within that sheet. Renaming the tabs of the excel workbook is must for the better understandably & usability within a team or when your working sheet has to be used by someone else in the company.

Rename Worksheet Tab – Excel VBA Macro Code :

Note : The cell values on each sheet should not be null and should be unique in the workbook since no two sheets can have the same name.

Sub RenameTabs()
' Renames all worksheet tabs with each worksheet's cell A1 contents.
'If cell A1 has no content, then that tab is not renamed.

For i = 1 To Sheets.Count
If Worksheets(i).Range("A1").Value <> "" Then
Sheets(i).Name = Worksheets(i).Range("A1").Value
End If
Next
End Sub

Rename Worksheet Tab – Excel VBA Macro Code :

Note : The cell values on each sheet can be null and should be unique in the workbook via using If – Else Function within this Rename Worksheet Tab VBA Code.

Sub RenameTabsHandlingNulls()
' Renames all worksheet tabs with each worksheet's cell A1 contents.
'If cell A1 has no content, then the tab is named as "Default"

For i = 1 To Sheets.Count
If Worksheets(i).Range("A1").Value <> "" Then
Sheets(i).Name = Worksheets(i).Range("A1").Value
Else:
Sheets(i).Name = "Default (" i &amp; ")"
End If
Next
End Sub

You can change the desired cell which would replace the worksheet tab name from A1 to any other Cell like B2 for all the ORG IMS SSA Output. You can save this VBA Code as a macro for later use as separate sheet or macro on this computer. If you don’t like to make your copy of the macro, here is my copy of the rename tab excel Macro sheet, which you can download & Use it.

Don’t forget to tell via comment, how helpful is this type of post on excel macro in your office use, so that I could provide you with some more tricks which i use on the daily basis.

You can follow me on Twitter at http://twitter.com/binterest.Do stay tuned to Binterest.com for more, Best Way 2 do it, Subscribe to Binterest's Feed Updates



Related Post :

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.



8 Speak Out ! »

  1. #VBA #Macro – Auto Rename #Excel #Worksheet Code http://goo.gl/fb/OUZZ Via @binterest #microsoftoffice #excel2010

    Comment by Malvinder Virdi — December 28, 2009 @ 2:34 PM

  2. VBA Macro – Auto Rename Excel Worksheet Code http://tinyurl.com/yclzvcb @binterest

    Comment by Malvinder Virdi — December 28, 2009 @ 2:34 PM

  3. VBA Macro – Auto Rename Excel Worksheet Code http://su.pr/23EgDc

    Comment by Malvinder Virdi — December 28, 2009 @ 2:40 PM

  4. VBA Macro – Auto Rename Excel Worksheet Code – How to auto rename excel worksheet tabs to specific cell via VBA cod… http://ow.ly/16eawD

    Comment by Malvinder Virdi — December 28, 2009 @ 6:52 PM

  5. #BINT : VBA Macro – Auto Rename Excel Worksheet Code – How to auto rename excel worksheet tabs to specific cell via… http://ow.ly/16eaFA

    Comment by Malvinder Virdi — December 28, 2009 @ 6:58 PM

  6. VBA Macro – Auto Rename Excel Worksheet Code http://su.pr/23EgDc

    Comment by Malvinder Virdi — December 29, 2009 @ 9:46 AM

  7. #Howto Auto Rename Excel Worksheet via VBA Macro http://su.pr/23EgDc #Office #Tips #VBA

    Comment by Malvinder Virdi — January 27, 2010 @ 8:38 AM

  8. [...] allows you to easily rename files and entire folders based upon extremely flexible criteria. …VBA Macro Auto Rename Excel Worksheet CodeHow to auto rename excel worksheet tabs to specific cell via VBA code or macro ? There is not [...]

    Pingback by rename - StartTags.com — January 27, 2010 @ 11:54 AM

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Hey, Look @ me I Write this !

    BInterestWelcome to Binterest.com | Am Analyst Cum Blogger, who likes to blog about Free Software, Webware, Giveaway, Firefox & its Add-ons, Tips & Tricks on Microsoft Office 2007 & 2010, Vista & Windows 7, Google, Microsoft. Sharing info which i thing would be worth sharing with readers like U

    Find Me Elsewhere

    Google Profile Twitter Facebook Deviantart Linkedin