![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Location: Wrexham, North Wales,UK
Posts: 10
|
Hello,
I'm trying to include a macro on a workbook that saves & closes it - but I'm having trouble. Any suggestions? Thanks Paul |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Where the wild roses grow
Posts: 285
|
The code would be:
Sub Saveandclose() ActiveWorkbook.Save ActiveWorkbook.Close End Sub Just paste it into a module in VBA Audiojoe [ This Message was edited by: Audiojoe on 2002-05-20 01:15 ] |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
Or: -
ActiveWorkbook.Close True To save it under it's current filename. Or: - ActiveWorkbook.Close True, "C:My DocumentsBook1.xls" replacing the path and filename with where you want it saved and what you want it called. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|