gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
I have this code which will take the selection and Paste it in A2
Sheets("3 Source Selection").Range("C" & ActiveCell.Row & ":" & "D" & ActiveCell.Row).Copy
Sheets("Selected CostSource").Range("A2").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
How do I modify this so that it paste it to the bottom of the table? My table starts in A1 on Selected CostSource
Sheets("3 Source Selection").Range("C" & ActiveCell.Row & ":" & "D" & ActiveCell.Row).Copy
Sheets("Selected CostSource").Range("A2").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
How do I modify this so that it paste it to the bottom of the table? My table starts in A1 on Selected CostSource
Code:
Sub SelectCostSourceData()
'***************************************
'Refresh Query to get unique ID and Rev
'***************************************
Application.ScreenUpdating = False
Sheets("3 Source Selection").Visible = True
Dim sh97 As Worksheet
Dim tblSourceList As ListObject
Dim Lastrow As ListRow
Dim SCR As Variant
Dim FND As Variant
Dim LR9 As Long
Set sh9 = Sheet9
Set tblSourceList = sh9.ListObjects("CostSource_Selections")
LR9 = Cells(Rows.Count, "B").End(xlUp).Row
If Intersect(ActiveCell, Range("B16:AJ" & LR9)) Is Nothing Then
MsgBox "You must select a Cost Source in column E (VendorName). Select a valid Cell, then click Select"
Exit Sub
End If
Sheets("3 Source Selection").Range("C" & ActiveCell.Row & ":" & "D" & ActiveCell.Row).Copy
Sheets("Selected CostSource").Range("A2").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
'deactivated while coding
'Sheets("Selected Part").Visible = xlSheetVeryHidden
' With ThisWorkbook
' Sheets("3 Source Selection").ListObjects(2).QueryTable.Refresh BackgroundQuery:=False
' End With
Sheets("3 Source Selection").Select
Range("C10").Select
Application.ScreenUpdating = True
'UserForm1.Show
End Sub