Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default partial search

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!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
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!!!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search for a partial number das Excel Worksheet Functions 2 May 30th 08 07:31 PM
Partial string search w/o VBA? MJW[_2_] Excel Discussion (Misc queries) 6 October 22nd 07 08:16 PM
how to use partial (word) search Vikky Excel Programming 1 July 14th 06 01:12 PM
Partial search and replace? Jamie Furlong Excel Discussion (Misc queries) 2 August 28th 05 03:54 PM
Partial Search using Macro Rachael[_3_] Excel Programming 4 November 24th 04 02:41 AM


All times are GMT +1. The time now is 11:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"