Have some code that I can't get to work. Its from copying from a series of worksheets in a workbook to a summary worksheet in teh same workbook.
The code goes as follows:
Sub Summary()
Dim Itemnum As String
For i = 2 To 500
Itemnum = Worksheets(1).Cells(i, 2)
If Itemnum = blank Then End
Sheets(1 + i).Select
Range("c9").Select
Selection.Copy
Sheets("Summary").Cells(2 + i, 1).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Next i
End Sub
when I runit I have problems with the line
sheets("summary").cells(2+i, 1).select
I can't figuge out why teh compiler is hanging here, I have used similar code on other sheets but instead of sheets I used worksheets instead of sheets. I also tried worksheets in place of sheets and it still did not work.
Anyone out there have any suggestions?
any help would be greatly appreciated
The code goes as follows:
Sub Summary()
Dim Itemnum As String
For i = 2 To 500
Itemnum = Worksheets(1).Cells(i, 2)
If Itemnum = blank Then End
Sheets(1 + i).Select
Range("c9").Select
Selection.Copy
Sheets("Summary").Cells(2 + i, 1).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Next i
End Sub
when I runit I have problems with the line
sheets("summary").cells(2+i, 1).select
I can't figuge out why teh compiler is hanging here, I have used similar code on other sheets but instead of sheets I used worksheets instead of sheets. I also tried worksheets in place of sheets and it still did not work.
Anyone out there have any suggestions?
any help would be greatly appreciated