Takes2ToTango
Board Regular
- Joined
- May 23, 2023
- Messages
- 69
- Office Version
- 365
- Platform
- Windows
Hi all,
I am running into an issue with populating the lrow of a table with copied data. I have pasted the code below. I am trying to get it to copy the data and then with the sheet 'DateQuery' I want it to paste into the lrow of the table. However, I am either getting data overridden or missing the table completely. I have also tried adding '+ 1' onto the end of the .Row.
I am running into an issue with populating the lrow of a table with copied data. I have pasted the code below. I am trying to get it to copy the data and then with the sheet 'DateQuery' I want it to paste into the lrow of the table. However, I am either getting data overridden or missing the table completely. I have also tried adding '+ 1' onto the end of the .Row.
VBA Code:
With ws2
lRow2 = Cells(Rows.Count, 1).End(xlUp).Row
'Loop from bottom to top deleting according to value in 1st column
For iCntr2 = lRow2 To 2 Step -1
If Cells(iCntr2, 6) = "QUERY" Then
Rows(iCntr2).Copy
With Sheets("DateQuery")
lRow3 = Sheets("DateQuery").Range("A" & Rows.Count).End(xlUp).Row 'Tried + 1 on the end of here but causes it to miss the table
.Range("A" & lRow3).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End With
Rows(iCntr2).Delete
End If
Next
End With