LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Error handling

Excel 97
I am attempting to move several sheets from one workbook to another for
purposes of emailing only the selected sheets. I am using an array to
select the sheets by name. The code works fine except when a sheet does
not exist. I would like to pop up an error message with the name of the
missing sheet and the option to continue with the sheets that exist. I have
limited experience in this area, and have tried on error goto ErrHandler,
but this does not continue moving the rest of the sheets in the array.
Below I have listed the code. Any help would be greatly appreciated.Thanks
Valerie

Sub ExportSouth()
'Macro Step 3 Export South Sheets
'Opens South Workbook and moves store Sheets to the workbook used for
emailing
'Opens Email to send to District manager

Workbooks.Open FileName:="\\xxx\xxx\xxx\Payroll\South Cover Sheet.xls"
Windows("cover.xls").Activate

Sheets(Array("41 Clark.", "43 Mad.", "44 N.A.", "49 Jeff.")).Move
Befo=Workbooks( _
"South Cover Sheet.xls").Sheets(1)
ActiveWorkbook.Save
Call Email
Sheets(Array("41 Clark.", "43 Mad.", "44 N.A.", "49 Jeff.")).Delete
ActiveWorkbook.Save
ActiveWorkbook.Close
Windows("cover.xls").Activate
Sheets("check List").Range("b9") = "X"

End Sub


 
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
Handling #NUM! error Michel Khennafi Excel Worksheet Functions 1 February 26th 07 08:49 PM
Error Handling Todd Excel Programming 1 February 13th 04 11:29 PM
Error handling Tim C Excel Programming 1 October 7th 03 10:00 PM
Error handling John Pierce Excel Programming 3 October 3rd 03 12:17 PM
Error Handling Bill Lunney Excel Programming 0 August 6th 03 11:56 PM


All times are GMT +1. The time now is 04:12 AM.

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"