I saw this on a post on Mr. Excel forum.
Sub NameRange()
Dim RowRange As Long
For RowRange = 1 To 15
Cells(RowRange, "A").Name = "Results" & RowRange
Next
End Sub
I'd like to learn how this can be converted into a function with the following parameters
* numStartRow : the row position from where to begin
* numEndRow : the row position where to end and numEndRow >= numStartRow
* varColumnHeader : a valid XL Column header A,B,C,....XFD
* varRangeNameIdentifier : A Text based Range Name to which suffix 1,2,3,....will be added.
The purpose is to pass to this function values such as NameRange(1,5,"B","EmployeeID"). The execution of the code should name cells from B1:B5 as EmployeeID1, EmployeeID2, ..., EmployeeID5
Help appreciated.
TIA.
Ninad.
Sub NameRange()
Dim RowRange As Long
For RowRange = 1 To 15
Cells(RowRange, "A").Name = "Results" & RowRange
Next
End Sub
I'd like to learn how this can be converted into a function with the following parameters
* numStartRow : the row position from where to begin
* numEndRow : the row position where to end and numEndRow >= numStartRow
* varColumnHeader : a valid XL Column header A,B,C,....XFD
* varRangeNameIdentifier : A Text based Range Name to which suffix 1,2,3,....will be added.
The purpose is to pass to this function values such as NameRange(1,5,"B","EmployeeID"). The execution of the code should name cells from B1:B5 as EmployeeID1, EmployeeID2, ..., EmployeeID5
Help appreciated.
TIA.
Ninad.