$$Excel-Macros$$ Re: Trouble with find

2009-05-30 Thread sjsean
sheet is called "No Sales" > If you loop from 1 to sheets.count, then when you get to > I = 3, sheet 3 is deleted, sheet 4 then becomes sheet3, (sheet 5 becomes 4, > etc) > so the loop would then SKIP checking what was sheet 4. > Then, when it got to i=10, it would ERROR, bec

$$Excel-Macros$$ Trouble with find

2009-05-27 Thread sjsean
I have a set of worksheets where the data provider always puts a sheet with "No Sales". I am trying to write a macro that will remove this sheet (and others if they fit the above criteria). Sub test() For i = 1 To Sheets.Count Sheets(i).Select Cells.Select Dim r As Range Set r = Selection.Find(W