Macros interupted by excel events...


Posted by Todd Ballinger on July 22, 1999 9:37 AM

I have just created a macro that formulates a market
profile for certain stocks. I use about 8 worksheets
to produce a daily and weekly report, when I finish
cut and pasting the values into my report using special
paste, values I then want to delete the old worksheets
which contain all of my formulas, etc. This is done also
because when I go to save the workbook after the macro
has been run, its size has been increased from a humble
130 kb to 14Mb!!!
Any other sugestions would be appreciated.

Thanks Todd.



Posted by Todd Ballinger on July 23, 1999 11:30 PM

Here is the code that allows you to bypass the popup alerts:

Application.DisplayAlerts = False
Dim WS1 As Worksheet
For Each WS1 In Worksheets
If Not (WS1.Name = "Report" Or WS1.Name = "Daily Data") Then
WS1.Delete
End If
Next WS1
Application.DisplayAlerts = True


Cheers Todd