Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default date/month problem

i have to link my workbook thru the vba code. The logic is
that i need to look for months. LIke if my worksheet is of
may month then i need to link with a column of anohter
workbook which is also may and likewise continue for
forthcoming months.

i search for may-04 in the workbook. My thought is what if
the user changes May-04 to May'04 or any other format....!
How to resolve this ambiguity...is there a way whereby i
put a condition??? or do i need to write a lot of if
condition's?????????

any thots will be appreciated
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default date/month problem

You could test left and right,

If Left(ActiveSheet.Name, 3) = Format(Date, "mmm") And _
Right(ActiveSheet.Name, 2) = Format(Date, "yy") Then
' do it

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

wrote in message
...
i have to link my workbook thru the vba code. The logic is
that i need to look for months. LIke if my worksheet is of
may month then i need to link with a column of anohter
workbook which is also may and likewise continue for
forthcoming months.

i search for may-04 in the workbook. My thought is what if
the user changes May-04 to May'04 or any other format....!
How to resolve this ambiguity...is there a way whereby i
put a condition??? or do i need to write a lot of if
condition's?????????

any thots will be appreciated



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
count month when date is in day/month/year format ccKennedy Excel Worksheet Functions 6 April 30th 09 03:32 AM
Problem Converting date to month in text for use in pivot table Peters Excel Worksheet Functions 2 October 31st 08 11:16 AM
Date arithmetic: adding 1 month to prior end of month date manxman Excel Worksheet Functions 2 July 14th 06 09:29 PM
Sort month/date/year data using month and date only SMW820 Excel Discussion (Misc queries) 6 June 22nd 06 05:14 PM
=VLOOKUP(1,Nationality!B5:B29,IF(MONTH(date)6,MONTH(date)-6, MON Ali Excel Worksheet Functions 14 January 18th 06 08:20 AM


All times are GMT +1. The time now is 05:50 AM.

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"