gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
Where I am pasting to is a table. My Titles in the Table (CMOPTable) start on Row 11 in B. Note the Table size will vary depending on what's being pasted each time.
This Pastes from the last Row up. So if the TABLE has 15 Rows in the table (and they are blank) and I select 3 items to Paste in; they paste in Rows 13, 14 and 15.
I need them to Past in the second 2 (of the table) and down.
Thank you for your time! Much appreciated
This Pastes from the last Row up. So if the TABLE has 15 Rows in the table (and they are blank) and I select 3 items to Paste in; they paste in Rows 13, 14 and 15.
I need them to Past in the second 2 (of the table) and down.
Code:
Private Sub CommandButton1_Click()
'Load Button
'Filter Selected Items (Yes)and then Copy and Paste to the next avaiable Row (B) on the CMOP
Dim lstrw As Long
lstrw = Sheets("CMOPUpload").Range("B" & Rows.Count).End(xlUp).Offset(1).Row
Range("E2").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(C[1],""Yes"")"
If Worksheets("ItemIDList").Range("E2").Value > 0 Then
ActiveSheet.Range("A4").AutoFilter Field:=6, Criteria1:="Yes", Operator:=xlFilterValues
Range("A3").Select
ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown).Offset(0, 4)).Copy
Sheets("CMOPUpload").Range("B" & lstrw).PasteSpecial xlPasteValues
Worksheets("ItemIDList").AutoFilterMode = False
ActiveSheet.ListObjects("ModelGeneral_vluItem").Range.AutoFilter Field:=6
Application.CutCopyMode = False
Sheets("CMOPUpload").Activate
Application.CutCopyMode = False
Else
MsgBox "You have not selected any items to load"
End If
End Sub
Thank you for your time! Much appreciated