+ Reply to Thread
Results 1 to 4 of 4

change worksheet name

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723

    Exclamation change worksheet name

    hi,

    i would like to change a number of worksheets names if there is data in a cell.

    ie . if A4 to N4 had data in them then change the worksheets names to the values in the cell 2 above them

    for example a4 had blue in it. a2 has "colour" in it, a4 has 48 in it a2 has house no in it

    i need to changa the worksheet names to suit the data in the row 2 if there is data in the row 4


    thank
    you

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    worksheet module

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    On Error Resume Next
    If Target.Address = "$A$1" Then
    Target.Parent.Name = Target.Value
    If Err.Number = 1004 Then MsgBox Err.Description
    End If
    End Sub


    when a value changes in A1 of the sheet you have the code in; the sheet tab will change accordingly, carefull though, could affect formulas and other macros

  3. #3
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723

    Question change worksheet name

    hi,

    sorry that i got it wrong and confused you but what i am after is

    row1 a has prefixed heading, ie colour.name,phone number, etc
    row 3 sometimes has data below the headings,
    if row 3 has data below the heading then create a new worksheet with the header name . if no data is in that row ignor and do not create a new worksheet

    sorry if this cause an inconveinece

    steve

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    Here's a site you could fine codes to add worksheets

    http://www.mvps.org/dmcritchie/excel/sheets.htm

    Create a new sheet named with the text value of a cell with a changed value in Column F (col 6).

+ 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