DevanG
06-10-2011, 10:50 AM
here we go... idk where my problem is... i don't really get the VBA debugs..
It points to my wbook.Sheets(1).Range("H" & j).Copy Workbooks(Name).Sheets(1).Cell(i, 22 + l) as not having a supported method...
after that.. please try to see what else is wrong with my loops..
' comparing contract numbers and inserting log numbers into summary
For i = 5 To 100 ' summary contracts
For j = 2 To 100 ' report contracts
If Workbooks(Name).Sheets(1).Range("B" & i).Value = wbook.Sheets(1).Range("A" & j).Value Then
For l = 1 To 100 ' find open log # pasting area
If Workbooks(Name).Sheets(1).Cells(i, 22 + l) = "" Then
wbook.Sheets(1).Range("H" & j).Copy Workbooks(Name).Sheets(1).Cell(i, 22 + l)
End If
Next l
i = i - 1 'to check for multiple logs
j = j + 1
GoTo P2
Else
If wbook.Sheets(1).Range("A" & j).Value = 0 Then 'to check if at end of report
GoTo P3
End If
End If
Next j
P3: If Workbooks(Name).Sheets(1).Range("B" & (i + 1)).Value = 0 Then 'to check if at end of summary
GoTo P4
End If
P2: Next i
P4:
It points to my wbook.Sheets(1).Range("H" & j).Copy Workbooks(Name).Sheets(1).Cell(i, 22 + l) as not having a supported method...
after that.. please try to see what else is wrong with my loops..
' comparing contract numbers and inserting log numbers into summary
For i = 5 To 100 ' summary contracts
For j = 2 To 100 ' report contracts
If Workbooks(Name).Sheets(1).Range("B" & i).Value = wbook.Sheets(1).Range("A" & j).Value Then
For l = 1 To 100 ' find open log # pasting area
If Workbooks(Name).Sheets(1).Cells(i, 22 + l) = "" Then
wbook.Sheets(1).Range("H" & j).Copy Workbooks(Name).Sheets(1).Cell(i, 22 + l)
End If
Next l
i = i - 1 'to check for multiple logs
j = j + 1
GoTo P2
Else
If wbook.Sheets(1).Range("A" & j).Value = 0 Then 'to check if at end of report
GoTo P3
End If
End If
Next j
P3: If Workbooks(Name).Sheets(1).Range("B" & (i + 1)).Value = 0 Then 'to check if at end of summary
GoTo P4
End If
P2: Next i
P4: