I've got the following code but it is only pasting the selected call into the closed workbook. I want the user to be able to select the current row or multiple rows and paste to the next blank row in the closed workbook.
Sub Button2_Click()
Dim FileName As String
Dim wb As Workbook
Dim irow As Long
Dim CopyRange As Range
Dim PasteRange As Range
FileName = "\\abc.com\confidential\Final.xlsx"
irow = ActiveCell.Row
Range(ActiveCell, ActiveCell.Offset(1, 8)).Copy
Application.ScreenUpdating = False
Set wb = Workbooks.Open(FileName, ReadOnly:=False)
'Next empty range in worksheet
With wb.Sheets("FINAL")
Set PasteRange = .Range("A" & .Cells(.Rows.Count, "A").End(xlUp).Row + 1)
End With
'paste values only
PasteRange.PasteSpecial Paste:=xlPasteValues
'save & close workbook
wb.Close True
Application.ScreenUpdating = True
MsgBox "Record Copied To Workbook.", 48, "Record Copied"
End Sub
Sub Button2_Click()
Dim FileName As String
Dim wb As Workbook
Dim irow As Long
Dim CopyRange As Range
Dim PasteRange As Range
FileName = "\\abc.com\confidential\Final.xlsx"
irow = ActiveCell.Row
Range(ActiveCell, ActiveCell.Offset(1, 8)).Copy
Application.ScreenUpdating = False
Set wb = Workbooks.Open(FileName, ReadOnly:=False)
'Next empty range in worksheet
With wb.Sheets("FINAL")
Set PasteRange = .Range("A" & .Cells(.Rows.Count, "A").End(xlUp).Row + 1)
End With
'paste values only
PasteRange.PasteSpecial Paste:=xlPasteValues
'save & close workbook
wb.Close True
Application.ScreenUpdating = True
MsgBox "Record Copied To Workbook.", 48, "Record Copied"
End Sub