Hi there,
OK here's the deal, I have two documents; 1 called payroll the other called rosters. I have used this forum to weed-out all but one bug in the code. this is at the point where the selected cells are pasted.
It doesnt matter if i change both of the cells.select to a range("a1:az65536").select it still errors at the Selection.Paste when the code is run.
If I take out the paste the code runs perfect. but i do need it to paste.
Cheers in advance.
OK here's the deal, I have two documents; 1 called payroll the other called rosters. I have used this forum to weed-out all but one bug in the code. this is at the point where the selected cells are pasted.
It doesnt matter if i change both of the cells.select to a range("a1:az65536").select it still errors at the Selection.Paste when the code is run.
If I take out the paste the code runs perfect. but i do need it to paste.
Cheers in advance.
Code:
Public Sub Data_Import()
Set WB = ActiveWorkbook
Set WB1 = Workbooks.Open(Application.GetOpenFilename)
MenuForm.Hide
Application.ScreenUpdating = False
Waiting.Show vbModeless
Waiting.Repaint
'open roster to import into payroll
WB1.Activate
Sheets("Master_Dump").Select
Cells.Select
Selection.Copy
'paste roster in to payroll document
WB.Activate
With Sheets("roster information").Select
Sheets("roster information").Unprotect Password:=Sheets("menu").Range("az27")
Cells.Select
Selection.Paste
Sheets("roster information").Protect Password:=Sheets("menu").Range("az27")
End With
'close the rostering document
WB1.Close
'back to main menu
Waiting.Hide
Sheets("blank").Select
MenuForm.Show
Application.ScreenUpdating = True
Waiting.Hide
End Sub