Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date definition 1

Status
Not open for further replies.

lamb666

Programmer
Apr 21, 2003
3
GB
hi i'm using VBA for a school computing coursework project and i've hit a rather large wall:

If ActiveWorkbook.Sheets("Data").Cells(datarow, 7) = * Then

Now the cell it refers to will have a date in it but i won't know what, so how do i tell it to expect a date, i have tried all the obvious things, but it keeps thinking I want to equal today's date!!!!!!! please help as this is needed in a hurry! Any ideas are welcome, asi will now be crying myself to sleep here in the UK! thanx in advance.
 
Could you post a little more code before and after? What is the goal of the IF statement?

You could try a SELECT CASE if you are trying to branch to various operations based on the month, day or year.
 
maybe this

If IsDate(ActiveWorkbook.Sheets("Data").Cells(datarow,7)) Then Do_this else do_that
 
ETID you are the MAN!!!!!!!!!!!!!!! (or woman, i don't know). You have litteraly saved my life. It works perfectly! Its annoying that things can be solved so simply yet if you have little experience then they will screw you up. Thanks again!!!!
 
EVERYTHING is simple.....as long as you know how to do it :)

Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
ok i have another query along the same line:

I want to tell it that a certain cell will contain a string, and there is no IsString function, so can anyone answer that?

thanks in advance
 
nope but in VBA, there is the
INSTR function
and in worksheets, there is the
FIND function

both of which find strings within strings

Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top