Batch Naming of ranges

A

Andy Chan

Dear all,

There are 80 sheets in my workbook. I want to name the ranges A1:B20
with systematic names in these 80 sheets, say, student_01 for Sheet1!A1:B20,
student_02 for Sheet2!A1:B20, ..., student_80 for Sheet80!A1:B20. Can I name
these ranges easily? Thanks.

Best Regards,
Andy
 
B

Bob Phillips

Dim i As Long
For i = 1 To 80
Worksheets("Sheet" & i).Range("A1:B20").Name = "student_" &
Format(i, "00")
Next i


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
A

Andy Chan

Thanks, it works!

Bob Phillips said:
Dim i As Long
For i = 1 To 80
Worksheets("Sheet" & i).Range("A1:B20").Name = "student_" &
Format(i, "00")
Next i


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Top