#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default excel file name?

Hi

I was wondering if anyone can help me?

Basically I would like excell to save a file in the name on cell A1 for
everytime I save someone on this perticular file. For example.

cell a1 says, 1001

I would like exell to save as 1001

If at a later point I change the 1001 to 1002 and click the save button I
would like it save the file as 1002 in the same folder as the other one?

Is this possible if so how???
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default excel file name?

Launch VBE using Alt+F11. From the left treeview double click 'This
Workbook'. Paste the below code and try..


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
strFolder = "c:\Jobs\"
ActiveWorkbook.SaveAs strFolder & Trim(Range("A1")) & ".xls"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Nigel123" wrote:

Hi

I was wondering if anyone can help me?

Basically I would like excell to save a file in the name on cell A1 for
everytime I save someone on this perticular file. For example.

cell a1 says, 1001

I would like exell to save as 1001

If at a later point I change the 1001 to 1002 and click the save button I
would like it save the file as 1002 in the same folder as the other one?

Is this possible if so how???

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default excel file name?

Revised...with default folder...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim strDefFolder As String
strDefFolder = "C:\"
Application.EnableEvents = False
Application.DisplayAlerts = False
If ActiveWorkbook.Path < vbNullString Then
strDefFolder = ActiveWorkbook.Path & "\"
End If
ActiveWorkbook.SaveAs strDefFolder & Trim(Range("A1")) & ".xls"
Cancel = True
Application.EnableEvents = True
Application.DisplayAlerts = True
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Nigel123" wrote:

Hi

I was wondering if anyone can help me?

Basically I would like excell to save a file in the name on cell A1 for
everytime I save someone on this perticular file. For example.

cell a1 says, 1001

I would like exell to save as 1001

If at a later point I change the 1001 to 1002 and click the save button I
would like it save the file as 1002 in the same folder as the other one?

Is this possible if so how???

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default excel file name?

Hi sorry im not a real technical person so can i try do this slowly

Im not sure what VBE is??? I did however press Alt+F11 and it just created a
new worksheet for me is that what im suppose to do?

"Jacob Skaria" wrote:

Launch VBE using Alt+F11. From the left treeview double click 'This
Workbook'. Paste the below code and try..


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
strFolder = "c:\Jobs\"
ActiveWorkbook.SaveAs strFolder & Trim(Range("A1")) & ".xls"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Nigel123" wrote:

Hi

I was wondering if anyone can help me?

Basically I would like excell to save a file in the name on cell A1 for
everytime I save someone on this perticular file. For example.

cell a1 says, 1001

I would like exell to save as 1001

If at a later point I change the 1001 to 1002 and click the save button I
would like it save the file as 1002 in the same folder as the other one?

Is this possible if so how???

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
double click excel file on the desktop excel opens but not file? JPT4266 Excel Discussion (Misc queries) 3 May 7th 09 04:24 PM
Excel hyperlink to another open Excel file - wants to reopen file WJ Callaghan Excel Worksheet Functions 1 March 7th 09 03:56 PM
Excel 2003: doubleclick on file opens Excel window, not file. Silvy Excel Discussion (Misc queries) 2 June 29th 06 12:15 PM
opening an excel file opens a duplicate file of the same file skm Excel Discussion (Misc queries) 1 December 7th 05 05:52 PM
Reflecting info between an excel file and a word one or two excel file. Starriol Excel Discussion (Misc queries) 0 November 3rd 05 01:49 PM


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