Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
If Statement help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Joel, post: 6353702"] the code will create a new workbook and copy the old sheet into new sheet and the macro will not be copied. from ChDir strSourceFolder ActiveWorkbook.SaveAs Filename:= _ strSourceFolder & "\TESTShip.xls", _ FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False to ChDir strSourceFolder First = true for each sht in activeworkbook.sheets if First = true then 'copy sheet into new workbook sht.copy set newbk = activeworkbook First = false else sht.copy after:=newbk.sheets(newbk.sheets.count) end if next sht ActiveWorkbook.SaveAs Filename:= _ strSourceFolder & "\TESTShip.xls", _ FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
If Statement help
Top