defined error

K

karaisland

Of a virus problem I had to reinstall my windows xp and office xp.
And I faced this highlighted error
" Application defined or object defined error "
No need to add this was a smoothly working vba code before.

Worksheets("compare1").Range("a2:iv10000").ClearContents

Any idea ? Thank you.
 
P

Per Jessen

Of a virus problem I had to reinstall my windows xp and office xp.
And I faced this highlighted error
" Application defined or object defined error "
No need to add this was a smoothly working vba code before.

Worksheets("compare1").Range("a2:iv10000").ClearContents

Any idea ? Thank you.

Hi

Nothing wrong with the statement.

Does the worksheet "compare1" exists in the active workbook?

regards,
Per
 
K

karaisland

If you get undefined variables for vb constants,
replace them with their numeric values.

Thank you Bob.
That is exactly what happened. How disturbing it is.
But why I never had such error before i don't understand.
 
K

karaisland

Worksheets("compare1").Range("a2:iv10000").ClearContents
this is not good

Worksheets("compare1").Range("a2:IV10000").ClearContents
this is good

Took my 2 days to find out a solution to
" Application defined or object defined error " . God !
 
D

Dave Peterson

Your problem may have gone away, but this was not the solution.

VBA doesn't care if your range address was in upper/lower/mixed case.
 
K

karaisland

Your problem may have gone away, but this was not the solution.

VBA doesn't care if your range address was in upper/lower/mixed case.

Hi Dave

But I didn't have any problem at all in the first place.
It was like finding your donkey after loosing.
I'd be so pleased if I know what the problem was.

Thanks
 
D

Dave Peterson

I've had some problems with .clearcontents when the area contained merged cells.

Any chance?
 
K

karaisland

I've had some problems with .clearcontents when the area contained merged cells.
Any chance?

Hi Dave

Upon further examinations on other files I decided that
I have a problem with letter " i ". Funny but true.
Again on below code same error msg appeared.

With Worksheets("costtabletour3").Range("g2:i1000").Validation

I have twice reinstalled xp' but no avail.
Only few days ago I had no such problem but now I am changing all "i"s
to " I ".

Thanks
 
D

Dave Peterson

And if you build a small test workbook and have just enough stuff to be able to
test, does it work ok (with the lowercase i)???
 
K

karaisland

And if you build a small test workbook and have just enough stuff to be able to
test, does it work ok (with the lowercase i)???

Hi Dave
Yes, I have built a fresh test workbook.
Any range addressed with " i " rather than " I " triggers that error
message.
Other letters have no difficulty lowercase or not.

Thanks
 
D

Dave Peterson

I've never seen anything like this.

Sorry,

Hi Dave
Yes, I have built a fresh test workbook.
Any range addressed with " i " rather than " I " triggers that error
message.
Other letters have no difficulty lowercase or not.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top