View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default macros and collections

I use the code below to get every worksheet and then test worksheet name to
determine how I process the sheets. You could name each of the wroksheet the
same 1st 4 letters and then use left(wsname,4) = "good"


Sub test()


For Each ws In Worksheets

wsname = ws.Name

If wsname = "Sheet1" Then

a = 1
End If


Next ws


End Sub

"DanW" wrote:

Hi,
I'm running a macro in Excel 2003, which I know need to change to only apply
to specific sheets in my workbook (2 thru 5 of 7). I tried to build a
collection of these sheets and failed. Any ideas on how to apply my macro to
specific sheets, either with or without a building collection, greatly
received.

Regards

Dan