Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello~ I would like to be able to include a section of code in my macro to b able to close the workbook in which the macro resides I've tried the below section of code (in red): Sub ReplaceNames() <MY CODE . . . 'Select a workbook to make active Workbooks("Replace_All Names.xls").Activate 'Close active workbook ActiveWorkbook.Close End Sub Note: the workbook which contains this macro is called "Replace_Al Names.xls" but this brings up the followng error message window: "Microsoft Excel cannot find matching data to replace. No cell in th selection contains what you typed, or no records match the criteria" Are there any other alternatives?? : -- dead_gir ----------------------------------------------------------------------- dead_girl's Profile: http://www.excelforum.com/member.php...fo&userid=1559 View this thread: http://www.excelforum.com/showthread.php?threadid=27145 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to Close a specific workbook. | Excel Discussion (Misc queries) | |||
Macro to close workbook with prompt | Excel Worksheet Functions | |||
Macro to close workbook and re-open new copy | Excel Discussion (Misc queries) | |||
run macro on workbook close | Excel Discussion (Misc queries) | |||
Close Workbook from Macro | Excel Programming |