Help! I got the same error using Excel 2003
Here is my code, and I got this error after it copies 63 times.
It will copy about 110 times.
Please help
Sub PopulateWorkSheet()
Dim totalrow, iSheet, rownum, v_col, icol As Integer
Dim mySht, metadata As Worksheet
Dim sheetname As String
Dim fnd As Range
Dim v_cell_value As Variant
totalrow = ActiveWorkbook.Worksheets("Tablename").UsedRange.Rows.Count
For iSheet = 1 To totalrow Worksheets("Template").Copy After:=Worksheets(Worksheets.Count)
Set mySht = Worksheets(Worksheets.Count)
sheetname = ActiveWorkbook.Worksheets("Tablename").Cells(iSheet, 1).Value
mySht.Name = sheetname
mySht.Cells(1, 1).Value = sheetname
Set metadata = Worksheets("List")
Set fnd = metadata.Columns(1l).Find(sheetname, LookAt:=xlWhole)
rownum = fnd.Row
v_col = 5
icol = 1
Do While metadata.Cells(rownum, v_col).Value <> ""
v_cell_value = metadata.Cells(rownum, v_col).Value
mySht.Cells(2, icol).Value = v_cell_value
v_col = v_col + 1
icol = icol + 1
Loop
Next iSheet
End Sub
Bookmarks