Thread: partial search
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default partial search

For j = 1 To i + 1
If instr(1,Sheets(j).Name,Format( _
Date, "YYYY-MM-DD"),vbTextcompare) Then
set sh = Sheets(j)
blnIsToday = True
End If
Next j

--
Regards,
Tom Ogilvy


"Arne Hegefors" wrote:

I have a macro. I want to search my worksheets to see if there is any
worksheet that has the current date as worksheet name. however the current
date may only be part of the worksheet name eg "2006-09-19" or "2006-09-19
Vector". I do not know how to find the ones that have a name like "2006-09-19
Vector". My code now is:
For j = 1 To i + 1
If Sheets(j).Name = Format(Date, "YYYY-MM-DD") Then 'wrong
blnIsToday = True
End If
pls help me!! thanks very much!!!