problem with interior.colorindex

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Could anyone suggest any general reasons why this code might report:
"Unable to set the colorindex property of the interior class"?

with target
blah blah blah
.Offset(0, 0).Resize(1, 10).Interior.ColorIndex = 40 'Tan Core
Infrastructure
yada yada yada
end with

I can select the range in a similar way using
..offset(0,0).resize(1,10).select, and the worksheet isn't protected.

Send me home happy for the weekend!

Thanks in advance

Pete
 
On reason would be the sheet is protected. You say it isn't, but that is
really the only reason I can think of

If you are using xl97, then at the top of the code put in

ActiveCell.Activate
 
I'm going to be no help, it worked fine for me. The only way I could get it
to fail was if there were less than 9 cells to the right of Target, that is
it was trying to resize off the edge.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
Please ignore me - elsewhere in my worksheet_change, some cell validation was
set - which of course was a change, which re-invoked the worksheet_change
macro...which.. er... re-activated the worksheet protection at the end!
Doh!

Sorry to waste your time.

Pete
 
Hi Pete,

Works fine for me, assuming target is not in the right-most 10 columns.

Not sure the purpose of .Offset(0,0)

Regards,
Peter T
 
Peter,

I know I don't need it, it's just for consistency, really, & helps me to
remember where I am (figuratively speaking).
Any way, it WAS a protection issue. Sorry to waste your time.

Pete
 

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