ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   problem with interior.colorindex (https://www.excelbanter.com/excel-programming/350996-problem-interior-colorindex.html)

Peter Rooney

problem with interior.colorindex
 
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

Tom Ogilvy

problem with interior.colorindex
 
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

--
Regards,
Tom Ogilvy

"Peter Rooney" wrote in message
...
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




Bob Phillips[_6_]

problem with interior.colorindex
 
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)

"Peter Rooney" wrote in message
...
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




Peter Rooney

problem with interior.colorindex
 
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



"Peter Rooney" wrote:

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


Peter T

problem with interior.colorindex
 
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 Rooney" wrote in message
...
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




Peter Rooney

problem with interior.colorindex
 
Bob, Sorry to waste your time, it WAS protection related.

Thanks

Pete



"Bob Phillips" wrote:

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)

"Peter Rooney" wrote in message
...
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





Peter Rooney

problem with interior.colorindex
 
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





"Peter T" wrote:

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 Rooney" wrote in message
...
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





Peter Rooney

problem with interior.colorindex
 
Tom, Sorry to waste your time, it WAS protection related.

Thanks

Pete


"Tom Ogilvy" wrote:

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

--
Regards,
Tom Ogilvy

"Peter Rooney" wrote in message
...
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






All times are GMT +1. The time now is 02:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com