I have built a VBA code that links cell contents from one Excel sheet Employee Form
to another worksheet Employee Database
in the same workbook as below.
Sub Submit_Form()
Dim LastRow As Long, ws As Worksheet
Set ws = Sheets("Employee Database")
LastRow = ws.Range("A" & Rows.Count).End(xlUp).Row + 1
ws.Range("A" & LastRow).Value = Worksheets("Employee Form").Range("D7").Value
....
ws.Range("Z" & LastRow).Value = Worksheets("Employee Form").Range("AB").Value
End Sub
The code works well, but how to modify the code now that these sheets are in separate Excel files? The new Excel files are the same as the respective names of these worksheets.
Thanks!