Copy the underlying names data in desired location
Create Names workbook level and sheet level
Private Sub CommandButton1_Click()
'List Names
Sheets("Sheet2").Range("I2").ListNames
End Sub
Private Sub CommandButton2_Click()
Dim i As Integer
For i = 2 To Range("B2").End(xlToRight).Column
Range(Cells(2, i), Cells(6, i)).Select
ThisWorkbook.Names.Add Name:=Cells(2, i).Value, RefersTo:=Selection
Next
End Sub
Private Sub CommandButton3_Click()
Sheets("sheet2").Names.Add Name:="Sh_Feb", RefersTo:=Range("C9:C13")
Sheets("sheet2").Names.Add Name:="Sh_App", RefersTo:=Range("D9:D13")
Sheets("sheet2").Names.Add Name:="Sh_Ban", RefersTo:=Range("E9:E13")
Sheets("sheet2").Names.Add Name:="Sh_tricks", RefersTo:=Range("F9:F13")
End Sub
Name Manager - Creation of Names
Private Sub CommandButton1_Click()
colcont = Range(Range("A1"), Range("A1").End(xlToRight)).Columns.Count
For i = 1 To colcont
'Range(Cells(1, i), Cells(1, i).End(xlDown)).Rows.Offset(1, 0).Select
Range(Cells(1, i), Cells(1, i).End(xlDown)).Rows.Select
Selection.Name = Cells(1, i)
Next
End Sub
Naming Procedure
Defining NAMES to Ranges
Private Sub CommandButton1_Click()
Range("A1:A5").Name = "First"
Range("B1:B5").Name = "second"
Range("C1:C6").Name = "Third"
Range("D1:D6").Name = "Forth"
End Sub
Define name at workbook level:
Private Sub CommandButton1_Click()
Names.Add Name:="Total", RefersTo:="=Sheet3!$A$1:$A$6"
End Sub
Define name at Sheet level:
Private Sub CommandButton1_Click()
Names.Add Name:="sheet4!limited", RefersTo:="=Sheet3!$A$1:$A$6"
End Sub
Assign variable to Name
Private Sub CommandButton1_Click()
Dim j As String
j = Range("A1").Value
'j="how are you"
Names.Add Name:="abc", RefersTo:=j
End Sub
Refer Names - with workbooks
Range("[Abc.xls]Sheet1!myranges").BorderAround Weight:=xlThin
Application.Goto reference:="Abc.xls!MyRanges"
Selection.BorderAround Weight:=xlThin
Range(myranges).Select
Selection.BorderAround Weight:=xlThin
CreateNames - Top,Left,Right,Bottom