Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default creat a macro to save a copy with different file name

I need to creat a macro that save a copy of the file, and take the file
name from a cell at the worksheet. this cell is changing everytime i
need to save the file, therefor i will not have the same file name.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 430
Default creat a macro to save a copy with different file name

One way:
Run Macro "Testme" and it will perform a
File, Save_As (to the current directory) creating
a File Name = to Cell J2.

Sub testme()
Application.Dialogs(xlDialogSaveAs).Show _
Worksheets("sheet1").Range("j2").Value & ".xls"
End Sub

HTH
Jim

"yrndtn" wrote in message
ups.com:

I need to creat a macro that save a copy of the file, and take the file
name from a cell at the worksheet. this cell is changing everytime i
need to save the file, therefor i will not have the same file name.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default creat a macro to save a copy with different file name

I named cell A1 on Sheet1, NewFileName, using the INSERT/NAME/DEFINE command
off the menu.

This is the file save code:

Sub SaveMe()

Dim strName As String

strName = Range("NewFileName").Text

If Len(strName) = 0 Then
MsgBox "There isn't a file name in cell A1."
Else
ActiveWorkbook.SaveAs strName
End If

End Sub
--
Kevin Backmann


"yrndtn" wrote:

I need to creat a macro that save a copy of the file, and take the file
name from a cell at the worksheet. this cell is changing everytime i
need to save the file, therefor i will not have the same file name.


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
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
Macro to save a file with ref to a tick box Ozzie via OfficeKB.com Excel Discussion (Misc queries) 4 January 31st 06 02:39 PM
Macro to auto save file using the format YYMM Dolphinv4 Excel Discussion (Misc queries) 1 September 29th 05 04:09 AM
save original data after macro is run again MINAL ZUNKE New Users to Excel 3 July 7th 05 12:48 PM
creat a macro to look for a file Kelly****** Excel Discussion (Misc queries) 1 January 2nd 05 09:24 AM


All times are GMT +1. The time now is 03:16 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"