View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
ewan7279 ewan7279 is offline
external usenet poster
 
Posts: 97
Default LOOP BETWEEN "FRONT" AND "END" SHEETS?

Hi Jan and Lonnie,

Thanks for the input!! I will go with Jan's approach, as there are a number
of sheets at the front of the workbook that I do not wish to paste data into,
and as he saya in this posting, the IF statement will add info into those
sheets. I'll let you know how I get on.

Thanks again,

Ewan.

"Jan Karel Pieterse" wrote:

Hi Lonnie,

Dim WS As Worksheet
For Each WS In Worksheets
If WS.Name < "Front" OR WS.Name < "End"
'Code to insert data
End If
Next


This will add the info to any sheet, because

1. the If clause always yields true (needs to be AND, not OR)
2. Sheets before and after Front and end are also accepted.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com