-
Solved: Renaming Worksheet during Copy fails
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]
my site: www.ecboardco.com
was built w/ a majority of the assistance from the board members here... thanks VBAX.
Just because I see something, doesn't mean that what's actually happening is what I see.
You don't get from 0-90 by standing still!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules