Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving as variable file name leerem Excel Discussion (Misc queries) 1 September 29th 08 10:30 AM
Saving a workbook with a variable name mwc0914[_4_] Excel Programming 1 July 26th 05 04:44 PM
Saving Workbook with Variable JJ Excel Programming 2 December 2nd 04 10:44 PM
Saving a Workbook: Forcing User to Rename before Saving Rollin_Again[_6_] Excel Programming 5 April 16th 04 02:54 PM
Saving Registry variable to ini file Allen[_3_] Excel Programming 0 September 10th 03 06:14 PM


All times are GMT +1. The time now is 04:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"