Copying the worksheet from Book1.xls to Masterworkbook.xls after Summary sheet. Original worksheet name is Sheet1, I wish to rename this worksheet to the original workbook name, & add the current date to the end.
Sheet1 would become Book1_7-30-07
[vba].Sheets("Sheet1").Name = Left(wbkName.Name, Len(wbkName.Name)-4) [/vba]is erroring.
The error is Object Required.
[vba]
Workbooks.Open Filename:=wbkName, IgnoreReadOnlyRecommended:=True
'open the workbook concerned
With ActiveWorkbook
With Worksheets("Sheet1")
'do your stuff here, change the sheetname as required
.Copy after:=Wsm
.Sheets("Sheet1").Name = Left(wbkName.Name, Len(wbkName.Name) - 4)
End With
.Close savechanges:=True
'close the workbook (saving any changes)
End With
Application.ScreenUpdating = True
End Sub
[/vba]