Anthony's VBA Forum Index Anthony's VBA Forum
Where the knowledge is shared
Menu
 Anthony's VBA Forum IndexHome Page
 Anthony's VBA Forum IndexForum Index
FAQFAQ
MemberlistMemberlist
UsergroupsUsergroups
RegisterRegister
ProfileProfile
Log in to check your private messagesMessages
Log inLogin/Out

Quick Search

Advanced Search

Links
Consulting
Products

Who's Online
[ Administrator ]
[ Moderator ]


Save workbook as multiple uniquely named workbooks

 
Post new topic   Reply to topic     Anthony's VBA Forum Index -> General Excel VBA
View previous topic :: View next topic  
Author Message
Nicky_5



Joined: 14 Aug 2008
Posts: 2

PostPosted: Thu Aug 14, 2008 6:05 am    Post subject: Save workbook as multiple uniquely named workbooks Reply with quote

Hi,

I am trying to write a macro that will open a workbook and then save it as something different, 150 times.
Please could you help me find a loop or bit of code that will allow me to do this?

Many thanks
Nicky
Back to top
View user's profile Send private message
mohan.ankur
Moderator
Moderator


Joined: 02 Aug 2006
Posts: 52

PostPosted: Tue Aug 19, 2008 1:56 pm    Post subject: Code Reply with quote

Sub Macro1()

For i = 1 To 150

YourPath = "Enter Your full path here like c:\abc\"

ActiveWorkbook.SaveAs Filename:= _
YourPath & i & ".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False
Next i
End Sub


Try manipulating this a bit

Ankur
_________________
http://www.exceldepot.com
http://www.xlmacros.com
http://www.learnexcel.org
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Nicky_5



Joined: 14 Aug 2008
Posts: 2

PostPosted: Wed Aug 20, 2008 3:16 am    Post subject: Reply with quote

Hi,

thats great! thank you Smile

Nicky
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Anthony's VBA Forum Index -> General Excel VBA All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group