I'm trying to write a Macro to upload data from one workbook called "OutcomeUpload" to the next empty row in "sheet1" on another workbook called "Postings". The code i'm using (below) finds and opens the "Postings" workbook but doesn't upload the data. I've tested the vba by posting to another sheet in the "OutcomeUpload" workbook instead of the "Posting" workbook and that works fine. However when I try to upload to the "postings" workbook I get an error message saying "Run Time Error" "Object doesn't support this property or method".
Sub OutcomeUpload()
Set wsForm = Sheet1
Set wsData = Workbooks.Open("C:\Excel\Postings.xlsm")
Worksheets("sheet1").Select
Set rNextCl = wsData.Cells(65536, 1).End(xlUp).Offset(1, 0)
With rNextCl
.Value = wsForm.Cells(20, 4).Value
.Offset(0, 1).Value = wsForm.Cells(20, 9).Value
.Offset(0, 2).Value = wsForm.Cells(20, 13).Value
.Offset(0, 3).Value = wsForm.Cells(20, 18).Value
.Offset(0, 4).Value = wsForm.Cells(20, 21).Value
.Offset(0, 5).Value = wsForm.Cells(20, 28).Value
End With
MsgBox "Upload Completed" & vbCrLf & "", vbInformation, "HELP"
wsForm.Range("OutcomeUpload").ClearContents
Set wsData = Nothing
Set wsForm = Nothing
Set rNextCl = Nothing
End Sub
the following rows seem to be the problem I think
Worksheets("sheet1").Select
Set rNextCl = wsData.Cells(65536, 1).End(xlUp).Offset(1, 0)
Hope you can help
Bookmarks