![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
How can I edit this code to ignore sheets 1 and 2 and always start at worksheet 3 ?
Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets If IsEmpty(ws.Range("B2")) Then _ ws.Range("B4:B36,G6:G29").ClearContents Next ws Eugene Robinson Rhos on Sea |
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
I am ssume you mean the sheets Index number when you say sheets 1 and 2, so this code should do it:
Dim i As Integer For i = 3 To Sheets.Count If IsEmpty(Sheets(i).Range("B2")) Then _ Sheets(i).Range("B4:B36,G6:G29").ClearContents Next i |
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
Thanks for that Dave. Does the job
Cheers Eugene |
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|