Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default if statement with date format

Hi All:

I have the statement below were "Tue" is in date format. That's is the
reason the macro doesn't read this field.
If ActiveCell.Offset(0, -10) Like "Tue*" And ActiveCell.Offset(0, -12) Like
"MB*" Then
How could I write this stamentent so that it works?

Thanks in advance for your help.

Orquidea
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default if statement with date format

Hi,

If it's a corrrectly formatted date then you can use weekday

If Weekday(ActiveCell.Offset(0, -10) = 3) And ActiveCell.Offset(0, -12) Like
"MB*" Then

Mike

"orquidea" wrote:

Hi All:

I have the statement below were "Tue" is in date format. That's is the
reason the macro doesn't read this field.
If ActiveCell.Offset(0, -10) Like "Tue*" And ActiveCell.Offset(0, -12) Like
"MB*" Then
How could I write this stamentent so that it works?

Thanks in advance for your help.

Orquidea

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default if statement with date format

Mike:

I have the correct date format but when the if statement evaluates the
condition, it is considering all days as 3. Would be any extra format I have
to do.

Thanks,
Orquidea

"Mike H" wrote:

Hi,

If it's a corrrectly formatted date then you can use weekday

If Weekday(ActiveCell.Offset(0, -10) = 3) And ActiveCell.Offset(0, -12) Like
"MB*" Then

Mike

"orquidea" wrote:

Hi All:

I have the statement below were "Tue" is in date format. That's is the
reason the macro doesn't read this field.
If ActiveCell.Offset(0, -10) Like "Tue*" And ActiveCell.Offset(0, -12) Like
"MB*" Then
How could I write this stamentent so that it works?

Thanks in advance for your help.

Orquidea

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
Convert date + time text format to date format Paul Ho Excel Worksheet Functions 2 May 22nd 07 05:47 PM
How to add date format into if statement? Eric Excel Worksheet Functions 6 November 5th 05 03:42 PM
How to add date format into if statement? Eric Excel Discussion (Misc queries) 4 November 5th 05 03:42 PM
Date Format Inside of a SUMIF Statement Minitman Excel Worksheet Functions 9 June 13th 05 07:52 PM
Excel 2000 date format cannot be set to Australian date format Brian Jones Excel Discussion (Misc queries) 1 March 30th 05 06:03 AM


All times are GMT +1. The time now is 09:22 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"