Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Exporting selected tabs multiple times to different file names

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ren - 28 Nov 2007 17:26 GMT
I have a file ("orinignal") that has tabs one, two, three.....

I want to write a macro to export tabs to seperate files and save them
automatically. FIle one would include tab one, two, three. File two would
include tab one, two, four, etc.

I know i can do

   Sheets(Array("one", "two", "three")).Select
   Sheets(Array("one", "two", "three")).Copy
   ActiveWorkbook.SaveAs Filename:= _
       "C:\one.xls" _
       , FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
       ReadOnlyRecommended:=False, CreateBackup:=False
   Windows("original.xls").Activate

My question is how do i get back to the original file without hardcoding the
file name like in windows("original.xls").active. Is there a method I can use
to get the file name and save it in a text string and refere it back by using
windows(string).activate .

I am also wondering how i can get a user input text box in excel so I can
ask the user where to save it. I can't remember the method and was probably
searching for the wrong terms in google.

Thanks,

Steven
Dave Peterson - 28 Nov 2007 17:54 GMT
Dim mySelection as Range
set mySelection = selection
'do your work
application.goto myselection

> I have a file ("orinignal") that has tabs one, two, three.....
>
[quoted text clipped - 24 lines]
>
> Steven

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.