Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Exporting selected tabs multiple times to different file names
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Exporting selected tabs multiple times to different file names
Dim mySelection as Range
set mySelection = selection 'do your work application.goto myselection Ren wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to get range names to Apply across multiple tabs | Excel Worksheet Functions | |||
Exporting file names to excel | Excel Programming | |||
copy selected tabs from multiple workbooks to a new workbook | Excel Worksheet Functions | |||
Exporting to a CSV file from multiple worksheets | Excel Programming | |||
Exporting from multiple worksheets to single text file | Excel Programming |