LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
BH BH is offline
external usenet poster
 
Posts: 14
Default create a macro to automaticaly name a file.

All I am trying to do is place a command button on a form that will name the
file from a cell and save the file under that name , I have not had any luck
so far. I may not be seeting up the macro the right way.

"Tom Ogilvy" wrote:

sPath = "C:\Temp\"
ActiveWorkbook.SaveAs sPath & Activesheet.Range("B9").Value

where cell B9 contains the name you want.

------------------

if you want the path in B8 and the name in B9

sPath = Range("B8").Value
if Right(spath,1) < "\" then sPath = sPath & "\"
ActiveWorkbook.SaveAs sPath & Activesheet.Range("B9").Value

------------------


If you want to save in the same location as the activeworkbook currently is
located

sPath = ActiveWorkbook.Path
if Right(spath,1) < "\" then sPath = sPath & "\"
ActiveWorkbook.SaveAs sPath & Activesheet.Range("B9").Value

--
Regards,
Tom Ogilvy


"BH" wrote in message
...
Tom;
I am looking to have the file name be what ever I enter into cell B9.
Thanks

"Tom Ogilvy" wrote:

if B9 contains the string C:\Temp\MyFile.xls

then C:\Temp\ is the file path.

The activeworkbook is saved to the C:\Temp directory with a filename of
MyFile.xls
--
Regards,
Tom Ogilvy


"BH" wrote in message
...
Tom:
Were do I inserte the file path.

"Tom Ogilvy" wrote:

Write a macro containing something like
ActiveWorkbook.SaveAs Activesheet.Range("B9").Value

where cell B9 contains the string

C:\Temp\MyFile.xls

--
Regards,
Tom Ogilvy

"BH" wrote in message
...
Harald: Is it possible to pull the information out of a cell

entered
in
the
worksheet?
Thanks
BH

"Harald Staff" wrote:

Write a macro containing something like
ActiveWorkbook.SaveAs "C:\Temp\MyFile.xls"
and assign it to your button.

HTH. Best wishes Harald


"bh" skrev i melding
...
I need to have control over file naming in a worksheet would

like
to
be
able
to do this by assiging a macro to a button.














 
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
excel file opened automaticaly at specified time & date aligaz Excel Discussion (Misc queries) 2 December 17th 07 04:45 PM
Can you automaticaly save a shared file every few mintues? Ben Excel Discussion (Misc queries) 0 February 7th 07 03:23 PM
Automaticaly create montly calendars for 30 employees YanYan Excel Discussion (Misc queries) 1 November 15th 05 01:01 AM
macro to save file automaticaly? david Excel Discussion (Misc queries) 1 May 6th 05 05:21 PM
Excel File To update Automaticaly Tom Ogilvy Excel Programming 0 September 3rd 03 12:21 PM


All times are GMT +1. The time now is 06:32 PM.

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

About Us

"It's about Microsoft Excel"