-
Copy/Paste Loop is only transferring rows 1,2, and 4, but not row 3?
Hi,
I am trying to troubleshoot this one kink so I can troubleshoot my major hiccup. I have a loop construct that works well (compliments to Paul) except out of the 4 rows it should copy and transfer, it is skipping number 3.
Here is the gist: 😊
Row 1 --> perfect, pastes in all the cells for the 0th loop
Row 2 --> perfect, pastes in all the cells for the 1st loop
Row 3 --> missing and not pasted?
Row 4 ---> lands on to the position of 2nd looped offset and leaves the 3rd looped offset empty.
I changed the loop line: For iBlockRow = 0 To 3 to For iBlockRow = 0 To 2 to see if I can catch Row 3's data and no whammy, still only copies Row 4.
Here is a synopsis of the code:
iOffset = 0
For iBlockRow = 0 To 3 ' <- 4 loops, 1 for each line
iStartRowOfLastBlock = iStartRowOfLastBlock + iBlockRow
With shtResult
.Cells(2, 3 + iOffset).Value = shtData.Cells(iStartRowOfLastBlock, 1).Value
.Cells(4, 3 + iOffset).Value = shtData.Cells(iStartRowOfLastBlock, 2).Value 'Way more code under here assigning more cells to multiple locations.
End With
iOffset = iOffset + 15 '<--All of the pasting cells are 15 columns apart on the "Result" sheet and are aligned correctly.
Next iBlockRow
Can someone help me find Row 3?
Thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules