Tags: based, book, cell, excel, grade, microsoft, msdn, rename, separate, sheet, software, student, students, tab, type, value, workbook, working

Rename sheet tab based on value in a cell

On Microsoft » Microsoft Excel

6,085 words with 5 Comments; publish: Thu, 22 May 2008 23:35:00 GMT; (306140.63, « »)

hello,

i'm working on a student grade book and use a separate sheet in the workbook

for each student. i type the students name in cell b1 and then have to

manually rename each sheet with the students name. i was wondering if there

was a way to have each tab automatically renamed based on the value in cell

b1?

thanks

indera

All Comments

Leave a comment...

  • 5 Comments
    • Indera,

      Put this code in the ThisWorkbook code module

      Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

      If Target.Address = "$B$1" Then

      Sh.Name = Target.Value

      End If

      End Sub

      HTH

      Bob Phillips

      ... looking out across Poole Harbour to the Purbecks

      (remove nothere from the email address if mailing direct)

      "Dr.Indera" <dr.inderaBUGOFF.excel.todaysummary.com.verizon.net> wrote in message

      news:uOQf%2325sDHA.2308.excel.todaysummary.com.TK2MSFTNGP11.phx.gbl...

      > hello,

      > i'm working on a student grade book and use a separate sheet in the

      workbook

      > for each student. i type the students name in cell b1 and then have to

      > manually rename each sheet with the students name. i was wondering if

      there

      > was a way to have each tab automatically renamed based on the value in

      cell

      > b1?

      > thanks

      > indera

      >

      #1; Thu, 22 May 2008 23:36:00 GMT
    • how about

      for each ws in worksheets

      ws.name =[b1]

      next

      --

      Don Guillett

      SalesAid Software

      donaldb.excel.todaysummary.com.281.com

      "Dr.Indera" <dr.inderaBUGOFF.excel.todaysummary.com.verizon.net> wrote in message

      news:uOQf%2325sDHA.2308.excel.todaysummary.com.TK2MSFTNGP11.phx.gbl...

      > hello,

      > i'm working on a student grade book and use a separate sheet in the

      workbook

      > for each student. i type the students name in cell b1 and then have to

      > manually rename each sheet with the students name. i was wondering if

      there

      > was a way to have each tab automatically renamed based on the value in

      cell

      > b1?

      > thanks

      > indera

      >

      #2; Thu, 22 May 2008 23:37:00 GMT
    • hi bob,

      i'm sorry for taking so long to get back to this newsgroup.

      i will try the code shortly.

      thank you.

      indera

      "Bob Phillips" <bob.phillips.excel.todaysummary.com.notheretiscali.co.uk> wrote in message

      news:uDPQ075sDHA.4060.excel.todaysummary.com.TK2MSFTNGP11.phx.gbl...

      > Indera,

      > Put this code in the ThisWorkbook code module

      > Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As

      Range)

      > If Target.Address = "$B$1" Then

      > Sh.Name = Target.Value

      > End If

      > End Sub

      >

      > --

      > HTH

      > Bob Phillips

      > ... looking out across Poole Harbour to the Purbecks

      > (remove nothere from the email address if mailing direct)

      > "Dr.Indera" <dr.inderaBUGOFF.excel.todaysummary.com.verizon.net> wrote in message

      > news:uOQf%2325sDHA.2308.excel.todaysummary.com.TK2MSFTNGP11.phx.gbl...

      > > hello,

      > >

      > > i'm working on a student grade book and use a separate sheet in the

      > workbook

      > > for each student. i type the students name in cell b1 and then have to

      > > manually rename each sheet with the students name. i was wondering if

      > there

      > > was a way to have each tab automatically renamed based on the value in

      > cell

      > > b1?

      > >

      > > thanks

      > > indera

      > >

      > >

      >

      #3; Thu, 22 May 2008 23:38:00 GMT
    • hi don,

      thank you. i will try out the code.

      indera

      "Don Guillett" <donaldb.excel.todaysummary.com.281.com> wrote in message

      news:u4soVG6sDHA.700.excel.todaysummary.com.TK2MSFTNGP11.phx.gbl...

      > how about

      > for each ws in worksheets

      > ws.name =[b1]

      > next

      > --

      > Don Guillett

      > SalesAid Software

      > donaldb.excel.todaysummary.com.281.com

      > "Dr.Indera" <dr.inderaBUGOFF.excel.todaysummary.com.verizon.net> wrote in message

      > news:uOQf%2325sDHA.2308.excel.todaysummary.com.TK2MSFTNGP11.phx.gbl...

      > > hello,

      > >

      > > i'm working on a student grade book and use a separate sheet in the

      > workbook

      > > for each student. i type the students name in cell b1 and then have to

      > > manually rename each sheet with the students name. i was wondering if

      > there

      > > was a way to have each tab automatically renamed based on the value in

      > cell

      > > b1?

      > >

      > > thanks

      > > indera

      > >

      > >

      >

      #4; Thu, 22 May 2008 23:39:00 GMT
    • Indera,

      FYI, Don's solution will go through your workbook and change the existing

      sheet names to whatever is in B1 of that sheet. My solution changes the

      sheet name whenever B1 in any sheet is changed. So Don's solution handles

      what is today, mine handles what happens tomorrow.

      You might want a combination of both.

      --

      HTH

      Bob Phillips

      ... looking out across Poole Harbour to the Purbecks

      (remove nothere from the email address if mailing direct)

      "Dr.Indera" <dr.inderaBUGOFF.excel.todaysummary.com.verizon.net> wrote in message

      news:eG18oRFvDHA.2360.excel.todaysummary.com.TK2MSFTNGP10.phx.gbl...

      > hi don,

      > thank you. i will try out the code.

      > indera

      >

      > "Don Guillett" <donaldb.excel.todaysummary.com.281.com> wrote in message

      > news:u4soVG6sDHA.700.excel.todaysummary.com.TK2MSFTNGP11.phx.gbl...

      > > how about

      > > for each ws in worksheets

      > > ws.name =[b1]

      > > next

      > >

      > > --

      > > Don Guillett

      > > SalesAid Software

      > > donaldb.excel.todaysummary.com.281.com

      > > "Dr.Indera" <dr.inderaBUGOFF.excel.todaysummary.com.verizon.net> wrote in message

      > > news:uOQf%2325sDHA.2308.excel.todaysummary.com.TK2MSFTNGP11.phx.gbl...

      > > > hello,

      > > >

      > > > i'm working on a student grade book and use a separate sheet in the

      > > workbook

      > > > for each student. i type the students name in cell b1 and then have to

      > > > manually rename each sheet with the students name. i was wondering if

      > > there

      > > > was a way to have each tab automatically renamed based on the value in

      > > cell

      > > > b1?

      > > >

      > > > thanks

      > > > indera

      > > >

      > > >

      > >

      > >

      >

      #5; Thu, 22 May 2008 23:40:00 GMT