Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Save file as filename plus fieldname


I wrote this complicated spreadsheet with macros with 5 sheets. I am not
good at macro writing, but the wizard helps. On open I unprotect the
fields the user has to fill in. The user manages periodically to mess
up my formulas, because he keeps saving my original file with data. I
don't know how he does it, but he does.

The spreadsheet is called Joist
I now searched and found that I can password protect the spreadsheet
and make it open in read only mode. It works fine, the user can still
enter data upon trying to save the spreadsheet excel prompts for file
name as: copy of_Joist.

Is it possible to write some code to make the filename a cell from the
spreadsheet, in this case Input!C2 has the pour number, for example
2458, I would like to save the spreadsheet as Joist2458.


--
annep
------------------------------------------------------------------------
annep's Profile: http://www.excelforum.com/member.php...o&userid=18851
View this thread: http://www.excelforum.com/showthread...hreadid=494480

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Save file as filename plus fieldname

Hi there,
You could try this code

Sub Macro1()

Dim fileext As String
Range("C2").Select
fileext = ActiveCell

ActiveWorkbook.SaveAs Filename:= _
"C:\Joist" & fileext & ".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
End Sub

"annep" wrote:


I wrote this complicated spreadsheet with macros with 5 sheets. I am not
good at macro writing, but the wizard helps. On open I unprotect the
fields the user has to fill in. The user manages periodically to mess
up my formulas, because he keeps saving my original file with data. I
don't know how he does it, but he does.

The spreadsheet is called Joist
I now searched and found that I can password protect the spreadsheet
and make it open in read only mode. It works fine, the user can still
enter data upon trying to save the spreadsheet excel prompts for file
name as: copy of_Joist.

Is it possible to write some code to make the filename a cell from the
spreadsheet, in this case Input!C2 has the pour number, for example
2458, I would like to save the spreadsheet as Joist2458.


--
annep
------------------------------------------------------------------------
annep's Profile: http://www.excelforum.com/member.php...o&userid=18851
View this thread: http://www.excelforum.com/showthread...hreadid=494480


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 to save file as different filename mac Excel Worksheet Functions 6 November 21st 07 10:43 PM
Auto save file copy with unique filename Allen Excel Worksheet Functions 1 June 27th 06 08:18 PM
Save filename as new file name C_Ascheman[_2_] Excel Programming 1 September 15th 05 01:05 AM
Save file, refer filename to cell and change directory Metin[_3_] Excel Programming 3 April 23rd 04 02:13 AM
Save excel file with filename = cell text TroyB[_2_] Excel Programming 1 November 26th 03 01:00 AM


All times are GMT +1. The time now is 07:29 AM.

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"