+ Reply to Thread
Results 1 to 2 of 2

Copy Range Names To Other Worksheets In Workbook

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-07-2012
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    156

    Copy Range Names To Other Worksheets In Workbook

    I have a workbook containing 12 worksheets that are identical except for the Worksheet Name. Each represents a month of the year. I would like to copy all the Named Ranges from Worksheet 1 to the other worksheets. I would appreciate your suggestions.

    Thanks for your help.

  2. #2
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Copy Range Names To Other Worksheets In Workbook

    Sub Copy_All_Defined_Names()
    
    Dim worksheet As worksheet
    
    Dim wsNamelen As Integer
    Dim wsName As String
       
        For Each Name In ActiveWorkbook.Names
            For Each worksheet In ThisWorkbook.Worksheets
                    If worksheet.Name <> wsName Then
                        worksheet.Names.Add Name:=Name.Name, RefersToLocal:=Name.RefersTo
                    End If
            Next worksheet
         Next Name
    End Sub
    assuming that the scope will be set to local ofc.
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

+ 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