Ok, I'm trying to copy a row from one workbook, and paste it to another one. For some reason, I'm getting an error at the code in red font. I'm not sure why, as I'm activating the page I want to paste the data to. I've verified that the data is going onto the clipboard, it's just not pasting. Where am I going wrong?
Code:
Private Sub cmd_Submit_Click()
Dim ws2, ws3, ws4 As Worksheet
Dim CS As Workbook
Dim CSPath As String
Dim CSFName As String
Set ws2 = ThisWorkbook.Sheets("Summaries")
Set ws3 = ThisWorkbook.Sheets("Bios")
Set ws4 = ThisWorkbook.Sheets("Pymt Tracker")
LastRow2 = ws2.Range("C" & Rows.Count).End(xlUp).Row
LastRow3 = ws3.Range("E" & Rows.Count).End(xlUp).Row
LastRow4 = ws4.Range("C" & Rows.Count).End(xlUp).Row
Set CS = Workbooks.Open("C:\Users\Rodger\Desktop\Bodies by Trish\CS_Template.xlsm")
CSPath = "C:\Users\Rodger\Desktop\Bodies by Trish\"
CSFName = Me.txt_ClientID
CS.Activate
CS.Sheets("Bio").Range("A2:Z2").Copy
ThisWorkbook.Activate
[COLOR=#ff0000]ws3.Range("A" & LastRow3 + 1).Paste[/COLOR]
Application.CutCopyMode = False
CS.Activate
ActiveWorkbook.SaveAs Filename:=CSPath & CSFName, FileFormat:=52
CS.Close
End If
MsgBox "The new Client's data has been recorded."
End Sub