hi all,
iam trying to create around 5000 named ranges through vba where the row no is variable .the selection area is column 4 to column 500 for each row and the name of the range is the value of column 1 in each row.
till now this is what iv managed to come up with.the text in red is where i need help.
Sub Generatearticlelist()
totalcount = Application.WorksheetFunction.CountA(Range("A4:A7000"))
For i = 1 To totalcount
If (Cells(3 + i, 1).Value > 0) Then
Range("cells(3+i,4):cells(3+i,500)").Select
ActiveWorkbook.Names.Add Name:=Cells(3+i,1), RefersToR1C1:= _
"=Sheet1!R3C1:R5000C3"
ActiveWorkbook.Names(cells(3+i,1).Comment = ""
Thank You
iam trying to create around 5000 named ranges through vba where the row no is variable .the selection area is column 4 to column 500 for each row and the name of the range is the value of column 1 in each row.
till now this is what iv managed to come up with.the text in red is where i need help.
Sub Generatearticlelist()
totalcount = Application.WorksheetFunction.CountA(Range("A4:A7000"))
For i = 1 To totalcount
If (Cells(3 + i, 1).Value > 0) Then
Range("cells(3+i,4):cells(3+i,500)").Select
ActiveWorkbook.Names.Add Name:=Cells(3+i,1), RefersToR1C1:= _
"=Sheet1!R3C1:R5000C3"
ActiveWorkbook.Names(cells(3+i,1).Comment = ""
Thank You