Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving a workbook with a variable name
I am trying to save a workbook in the same directory as the workbook am working from. Also, I may exceute this macro several times while m workbook is open, so I need to figure a way to vary the "Book1" valu each time the macro is executed. What I so far... Workbooks.Add Windows("tourney.xls").Activate Range("A1:C3").Select Selection.Copy Windows("Book1").Activate Range("A1").Select ActiveSheet.Paste Range("A5").Select Application.CutCopyMode = False ActiveWorkbook.SaveAs Filename:=Range("c1"), _ FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False This is saving the new workbook in the "My Documents" directory. Ho can I get it to save in the same directory as where the workbook I a working from is contained? Also how can I vary the "Book1" value so i I execute this macro several times while my workbook is open, I'll b able to find the latest Book so it will be named correctly -- mwc091 ----------------------------------------------------------------------- mwc0914's Profile: http://www.excelforum.com/member.php...fo&userid=2413 View this thread: http://www.excelforum.com/showthread.php?threadid=39022 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving a workbook with a variable name
Can I build a path name using the CurDir command and concatinating tha with the value in the cell that represents the file name I want to sav the workbook as? Then assign that full path name to a variable an reference the variable in the Filename parameter -- mwc091 ----------------------------------------------------------------------- mwc0914's Profile: http://www.excelforum.com/member.php...fo&userid=2413 View this thread: http://www.excelforum.com/showthread.php?threadid=39022 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving a workbook with a variable name
Sure
-- Regards, Tom Ogilvy "mwc0914" wrote in message ... Can I build a path name using the CurDir command and concatinating that with the value in the cell that represents the file name I want to save the workbook as? Then assign that full path name to a variable and reference the variable in the Filename parameter? -- mwc0914 ------------------------------------------------------------------------ mwc0914's Profile: http://www.excelforum.com/member.php...o&userid=24130 View this thread: http://www.excelforum.com/showthread...hreadid=390225 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving as variable file name | Excel Discussion (Misc queries) | |||
Saving a workbook with a variable name | Excel Programming | |||
Saving Workbook with Variable | Excel Programming | |||
Saving a Workbook: Forcing User to Rename before Saving | Excel Programming | |||
Saving Registry variable to ini file | Excel Programming |