Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tanyhart,
Rather than deleting and recreating the sheets, why not delete the data, e.g.: '============= Private Sub Workbook_Open() Dim SH As Worksheet For Each SH In Me.Worksheets If UCase(Trim(SH.Name)) < "MAIN" Then '<<==== CHANGE SH.Cells.Clear End If Next SH End Sub '<<============= This is workbook event code and should be pasted into the workbook's ThisWorkbook module *not* a standard module or a sheet module: Right-click the Excel icon on the worksheet (or the icon to the left of the File menu if your workbook is maximised) Select 'View Code' from the menu and paste the code. Alt-F11 to return to Excel. --- Regards, Norman "tanyhart" wrote in message ... I have a macro that will create data sheets based upon the main worksheets information. What I was wondering is, upon exiting the file, can I have excel delete those created sheets so that when the file is opened again the macro can be run and new data presented? Thanks -- tanyhart ------------------------------------------------------------------------ tanyhart's Profile: http://www.excelforum.com/member.php...o&userid=35148 View this thread: http://www.excelforum.com/showthread...hreadid=554671 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming |