View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Andy Pope Andy Pope is offline
external usenet poster
 
Posts: 2,489
Default "Not" and "Not Like"

Hi Grant,

You need to add WSh.name to the second part of the test as well.

If WSh.Name < "Admin" and WSh.Name < "Server * Projection Seed
Values" Then

Cheers
Andy

Grant Reid wrote:

Hi

I need to perform arbitary actions on all sheets in my workbook except for a
sheet with the name "Admin" and any sheets with the following naming
convention "Server * Projection Seed Values". Am at my wits end with this
one. Can anyone help. See my code below;

Dim qt As QueryTable
Dim WSh As Worksheet

For Each WSh In ThisWorkbook.Worksheets
If WSh.Name < "Admin" and < "Server * Projection Seed Values"
Then '<------ This is the problem area
'Perform action here
End If
Next WSh

End Sub

Many Thanks - Grant



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info