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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch on statements that has run

Status
Not open for further replies.

mac7attack

Technical User
Jan 31, 2004
47
0
0
US
Hi

I am getting a Type Mismatch error on a statement that runs 90 some times before erroring out.

Here's the statement. Type mismatch on the same variable?
Final.Cells(y, AnWeekCol) = 1 + Final.Cells(y, AnWeekCol)

Cell contain 30 when error happens.

Thanks in advanced
MAC
 
what are the variables "y" & "anWeekCol" defined as ?

please post the code for the whole loop

Rgds, Geoff

Three things are certain. Death, taxes and lost data. DPlank is to blame

Please read FAQ222-2244 before you ask a question
 
I hate to say this, but, are you sure. You even say so yourself, that it runs before erroring out, and you know that a cell value of 30 wouldn't cause it ... so, the only thing left is that your pointers are not pointing to the cell you think they are.

How do you know the cell contains 30? Do you go into debug when the error happens, and check the values, addresses, pointers and so on?

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
You may try this:
Final.Cells(y, AnWeekCol) = 1 + Val(Final.Cells(y, AnWeekCol))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top