Re: $$Excel-Macros$$ How to delete alternate sheets faster

2012-10-31 Thread NOORAIN ANSARI
Dear Pravin, Please try Sub delete_alternative_sheet() Dim i As Integer On Error Resume Next For i = 2 To Sheets.Count Step 2 Sheets(i).Delete Next i End Sub On Thu, Nov 1, 2012 at 10:51 AM, Pravin Gunjal wrote: > *Dear Friends,* > * > * > *Greetings !* > * > * > *I am having an excel file (o

Re: $$Excel-Macros$$ How to delete alternate sheets faster

2012-10-31 Thread Pravin Gunjal
*Dear Noorain* * * *Pl inform how to and where to use this code..* *Thank you.* * * *Pravin. * On Thu, Nov 1, 2012 at 11:04 AM, NOORAIN ANSARI wrote: > Dear Pravin, > > > Please try > > Sub delete_alternative_sheet() > Dim i As Integer > On Error Resume Next > For i = 2 To Sheets.Count Step 2 >

Re: $$Excel-Macros$$ How to delete alternate sheets faster

2012-10-31 Thread NOORAIN ANSARI
Dear Pravin, Please press Alt+F11 and goto Insert-module and paste code and press F5 to execute macro. Hope it will useful for you. On Thu, Nov 1, 2012 at 11:40 AM, Pravin Gunjal wrote: > *Dear Noorain* > * > * > *Pl inform how to and where to use this code..* > *Thank you.* > * > * > *Pravi

Re: $$Excel-Macros$$ How to delete alternate sheets faster

2012-10-31 Thread Aamir Shahzad
Dear Noorain Sir, Can you ammend your code that when we run macro, a message box appear and ask for select the sheets which you want to delete and we will select the multiple sheet which we want to delete. Aamir Shahzad On Thu, Nov 1, 2012 at 11:34 AM, Pravin Gunjal wrote: > *Dear Noorain* > *I

Fwd: $$Excel-Macros$$ How to delete alternate sheets faster

2012-11-01 Thread Pravin Gunjal
*It would be better... * -- Forwarded message -- From: Aamir Shahzad Date: Thu, Nov 1, 2012 at 12:13 PM Subject: Re: $$Excel-Macros$$ How to delete alternate sheets faster To: excel-macros@googlegroups.com Dear Noorain Sir, Can you ammend your code that when we run macro, a

Re: $$Excel-Macros$$ How to delete alternate sheets faster

2012-11-01 Thread Paul Schreiner
l the ways you can, In all the places you can, At all the times you can, To all the people you can, As long as ever you can.” - John Wesley - From: NOORAIN ANSARI To: excel-macros@googlegroups.com Sent: Thu, Nov

Re: $$Excel-Macros$$ How to delete alternate sheets faster

2012-11-01 Thread Ahmed Honest
> > > > If (Sheets.Count Mod 2 = 0) Then > ShtCnt = Sheets.Count > Else > ShtCnt = Sheets.Count - 1 > End If > > for I = shtcnt to 2 step -2 > > > > > > (the code would be best placed in a "Standard" module, or the Sheet1 > module) > > > > *Paul* > >

Re: $$Excel-Macros$$ How to delete alternate sheets faster

2012-11-01 Thread Sam Mathai Chacko
; >> then you can use: >> >> For I = 42 to 2 step -2 >> >> >> >> If you don't know the total number of sheets, you can use: >> >> >> >> >> If (Sheets.Count Mod 2 = 0) Then >> ShtCnt = Sheets.Count >>

Re: $$Excel-Macros$$ How to delete alternate sheets faster

2012-11-01 Thread Paul Schreiner
al Sent: Thu, November 1, 2012 8:24:16 AM Subject: Re: $$Excel-Macros$$ How to delete alternate sheets faster Another way would be to create an array of sheet names and the delete it accordingly. So even if you go with a positive Step, it would still work. Based on the suggestions above, you

Fwd: $$Excel-Macros$$ How to delete alternate sheets faster

2012-11-01 Thread Pravin Gunjal
Schreiner Date: Thu, Nov 1, 2012 at 5:16 PM Subject: Re: $$Excel-Macros$$ How to delete alternate sheets faster To: excel-macros@googlegroups.com That's not going to work out well. Let's say you have 11 sheets the Sheets() array looks like: Sheets(1).Name = "One" Sheets(2).N

Re: $$Excel-Macros$$ How to delete alternate sheets faster

2012-11-05 Thread Paul Schreiner
.” - John Wesley - From: ANKUR AGGARWAL To: "excel-macros@googlegroups.com" Cc: "noorain.ans...@gmail.com" Sent: Mon, November 5, 2012 6:33:01 AM Subject: Re: $$Excel-Macros$$ How to delete alternate she