help with debugging

  • Thread starter Thread starter Jo
  • Start date Start date
J

Jo

Hi
Hope someone can help me with this..
I am trying to delete a reference to another page and I
get a "Select method of range class failed".
I changed the code to clear the whole column instead if
just some cells, but this still doesn't work.
Help!
Thanks
Jo

Columns("C:C").Select
Selection.ClearContents
 
maybe:
worksheets("sheet1").range("c:c").clearcontents
or
worksheets("sheet1").columns(3).clearcontents

Or if you're using xl97 and running this code from a control (on a worksheet)
from the controltoolbox toobar, change that control's .takefocusonclick property
to false.

If it doesn't have .takefocusonclick, then add this line to the top of your
code:

activecell.activate
 
Cannot really see your problem. Depends on the rest of your code.
Usual reason for this error is because you can only use Select if the
designated worksheet is active [eg. Worksheets("Sheet1").Activate
first]. Your code is OK and should select column C in the active
worksheet. Perhaps you had not noticed this is happening.


Regards
BrianB
=================================
 

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

Back
Top