ExcelBanter

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

Arne Hegefors

Object required
 
Hi! I have a problem with a simple code piece. when trying to run the code
below I get the error: "Object required". Please help me solve this! Thank
you very much!

ratingCell = Range("c9")
pos = 1
i=1
ratingCell.Offset(pos, i) = "test"

Ron Coderre

Object required
 
When assigning objects to object variables you must use the SET keyword.

Try this:

SET ratingCell = Range("c9")
pos = 1
i=1
ratingCell.Offset(pos, i) = "test"

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Arne Hegefors" wrote:

Hi! I have a problem with a simple code piece. when trying to run the code
below I get the error: "Object required". Please help me solve this! Thank
you very much!

ratingCell = Range("c9")
pos = 1
i=1
ratingCell.Offset(pos, i) = "test"



All times are GMT +1. The time now is 01:39 AM.

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