ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Object required? (https://www.excelbanter.com/excel-programming/325889-object-required.html)

Tony

Object required?
 
This code snippet produces RT error "Object Required" (424)
and halts on the With ..

Dim r As Range
Set r = Sheets("Sheet1").Range("O13:R21")
With r.Interior.Color
.ColorIndex = 50
.Pattern = xlSolid
End With

What am I not getting here?

Thanks, Tony

Dave Peterson[_5_]

Object required?
 
r.Interior.Color
is a simple value--not an object.

Maybe you wanted:
With r.Interior


Tony wrote:

This code snippet produces RT error "Object Required" (424)
and halts on the With ..

Dim r As Range
Set r = Sheets("Sheet1").Range("O13:R21")
With r.Interior.Color
.ColorIndex = 50
.Pattern = xlSolid
End With

What am I not getting here?

Thanks, Tony


--

Dave Peterson

Tony

Object required?
 
Thanks - I'm reminded of that great line in Amadeus:

"There are too many notes."

Too many things for my tiny mind to keep track of.

Tony
-----Original Message-----
r.Interior.Color
is a simple value--not an object.

Maybe you wanted:
With r.Interior


Tony wrote:

This code snippet produces RT error "Object Required"

(424)
and halts on the With ..

Dim r As Range
Set r = Sheets("Sheet1").Range("O13:R21")
With r.Interior.Color
.ColorIndex = 50
.Pattern = xlSolid
End With

What am I not getting here?

Thanks, Tony


--

Dave Peterson
.



All times are GMT +1. The time now is 07:19 AM.

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