Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Save workbook with a name mentioned in a cell

Hi Danny:

Re-package your macro into the workbook event form:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
' Danny's code
Cancel = True
End Sub

This goes in the ThisWorkbook code area, not in a standard module.
--
Gary''s Student - gsnu200737


"Danny" wrote:

Hi,

I have tried to use explaination from the community, but till know this did
not work.

Can someone advise me on the following?

I want to save a workbook with a refference in a cell, at the moment i use:

Private Sub Workbook_Save()
Dim rng As Range

Set rng = ActiveSheet.Range("M2")

ActiveWorkbook.SaveAs _
Filename:=rng.Value & ".xls", _
FileFormat:=xlWorkbookNormal

End Sub

This is working if i run it manually, but what do i need to do to activate
this when i click on the save buton?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Save workbook with a name mentioned in a cell

Sorry... the tiny icon is to the LEFT of File, not the right
--
Gary''s Student - gsnu200737


"Danny" wrote:

Hi Gary,

I'm not that familiar with Macro's is there an easy way to have this
explained, it is not clear to me of what you exactly mean?

Thanks

"Gary''s Student" wrote:

Hi Danny:

Re-package your macro into the workbook event form:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
' Danny's code
Cancel = True
End Sub

This goes in the ThisWorkbook code area, not in a standard module.
--
Gary''s Student - gsnu200737


"Danny" wrote:

Hi,

I have tried to use explaination from the community, but till know this did
not work.

Can someone advise me on the following?

I want to save a workbook with a refference in a cell, at the moment i use:

Private Sub Workbook_Save()
Dim rng As Range

Set rng = ActiveSheet.Range("M2")

ActiveWorkbook.SaveAs _
Filename:=rng.Value & ".xls", _
FileFormat:=xlWorkbookNormal

End Sub

This is working if i run it manually, but what do i need to do to activate
this when i click on the save buton?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 148
Default Save workbook with a name mentioned in a cell

Hi Gary,

I'm not that familiar with Macro's is there an easy way to have this
explained, it is not clear to me of what you exactly mean?

Thanks

"Gary''s Student" wrote:

Hi Danny:

Re-package your macro into the workbook event form:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
' Danny's code
Cancel = True
End Sub

This goes in the ThisWorkbook code area, not in a standard module.
--
Gary''s Student - gsnu200737


"Danny" wrote:

Hi,

I have tried to use explaination from the community, but till know this did
not work.

Can someone advise me on the following?

I want to save a workbook with a refference in a cell, at the moment i use:

Private Sub Workbook_Save()
Dim rng As Range

Set rng = ActiveSheet.Range("M2")

ActiveWorkbook.SaveAs _
Filename:=rng.Value & ".xls", _
FileFormat:=xlWorkbookNormal

End Sub

This is working if i run it manually, but what do i need to do to activate
this when i click on the save buton?

Thanks

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
Save workbook with a name mentioned in a cell Gary''s Student Excel Discussion (Misc queries) 0 August 17th 07 01:53 AM
Shared workbook - to save or not to save bluebird Excel Discussion (Misc queries) 1 November 14th 06 06:17 PM
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
Run Macro(save workbook) after cell updated titch New Users to Excel 3 February 5th 06 07:55 PM
I want a macro to save a workbook as a user inputted cell EAHRENS Excel Discussion (Misc queries) 3 November 8th 05 03:28 PM


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