Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Cillian
 
Posts: n/a
Default Save as Macro in excel - Help needed!!

Hi,

I have a macro with these lines in it:

FName = Cells(2, 2).Value
ActiveWorkbook.SaveAs Filename:=FName

This works fine and saves the file as the value in the cell - however I want
to be able to call the file by the value in three cells and also add some
text, so the file name would look like:

"Reference (Cells (2,2).Value) Region (Cells (4,2).Value) Day (Cells
(5,2).value)"

Can anyone help??????


--
Cillian
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Save as Macro in excel - Help needed!!

dim myFileName as string
with worksheets("Sheet99")
myfilename = .cells(2,2).value & " Region " & .cells(4,2).value _
& " Day " & .cells(5,2).value
end with

Remember that if any of those cells contain a date, you may have to format the
value to use it as a file name:

.... & " Day " & format(.cells(5,2).value,"yyyymmdd")






Cillian wrote:

Hi,

I have a macro with these lines in it:

FName = Cells(2, 2).Value
ActiveWorkbook.SaveAs Filename:=FName

This works fine and saves the file as the value in the cell - however I want
to be able to call the file by the value in three cells and also add some
text, so the file name would look like:

"Reference (Cells (2,2).Value) Region (Cells (4,2).Value) Day (Cells
(5,2).value)"

Can anyone help??????

--
Cillian


--

Dave Peterson
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
macro save a workbook whilst increasing file no shrek Excel Worksheet Functions 0 November 10th 05 02:40 PM
Excel 2000 cannot save and create temp file GK Setting up and Configuration of Excel 1 October 25th 05 10:33 PM
Macro excel save mrbalaje Excel Discussion (Misc queries) 1 May 12th 05 06:27 PM
Save & Save As features in file menu of Excel Blue Excel Discussion (Misc queries) 9 December 27th 04 08:49 PM
Macro in Excel 2002 to save a workbook to a FTP location Lloyd Excel Discussion (Misc queries) 0 December 21st 04 02:49 PM


All times are GMT +1. The time now is 12:48 AM.

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"