Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Nigel
 
Posts: n/a
Default macro to start on workbook opening

Hi,
can anyone help me with a macro to start on opening a book?
when the book is opened, start this " Nextstage.Show "

Then when i save, if the file name = quotes & orders then rename it to (D2 &
quotes & orders). this is to stop the possibility of the same named file
being open twice.

Kindest Regards,

Nigel
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If ThisWorkbook.Name = "quotes & orders.xls" Then
ThisWorkbook.SaveAs "D2 quotes & orders.xls"
Cancel = True
End If
End Sub

Private Sub Workbook_Open()
NextStage.Show
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Nigel" wrote in message
...
Hi,
can anyone help me with a macro to start on opening a book?
when the book is opened, start this " Nextstage.Show "

Then when i save, if the file name = quotes & orders then rename it to (D2

&
quotes & orders). this is to stop the possibility of the same named file
being open twice.

Kindest Regards,

Nigel



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 browse for workbook, pick up data and looping uriel78 Excel Worksheet Functions 1 March 10th 05 12:37 PM
Extract specific data into its own workbook via macro? Adrian B Excel Discussion (Misc queries) 2 February 24th 05 06:09 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
workbook macro help ditchy Excel Discussion (Misc queries) 2 December 27th 04 04:48 AM
Inserting Blank Rows Macro? Michael Saffer Excel Worksheet Functions 2 November 9th 04 06:23 PM


All times are GMT +1. The time now is 01:34 PM.

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"