LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default using if statement to compare text

My program is supposed to read dates out of the spreadsheet, but
sometimes there are text strings instead. On these instances I need to
write an if statement telling the program to go elsewhere when it
encounters this string. This may be really simple, but when i type
If MyDate = "TK" then
blah blah blah....


i get a mismatch error on the "TK" part. am i doing something wrong
there? what is the proper way to compare a text string to a variable.
and i know MyDate is getting the "tk" cause i had a message box pop up
to tell me the value of it right above it.

thanks

 
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
IF Statement - compare to coloured cell LinLin Excel Worksheet Functions 7 April 14th 09 11:43 PM
using IF statement to compare text RichN Excel Worksheet Functions 4 November 1st 06 09:48 PM
If statement to compare for wildcard value in another cell. Karen53 Excel Worksheet Functions 3 July 12th 06 05:28 AM
compare TIME in IF statement No Name Excel Programming 8 July 10th 05 09:11 PM
compare time in IF statement Excel Worksheet Functions 4 July 10th 05 06:18 PM


All times are GMT +1. The time now is 10:33 AM.

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

About Us

"It's about Microsoft Excel"