ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Object not set (https://www.excelbanter.com/excel-programming/441152-re-object-not-set.html)

FSt1

Object not set
 
hi
try...
set selection.find(what:=etc,etc,etc

Regards
FSt1

"David" wrote:

Hi Group,

Hope all are having a good day. The code has this object not set:

For i = 1 To 4
Selection.Find(What:=" & (Date1) & ", After:=ActiveCell,
LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Close1 = ActiveCell.Offset(0, 4).Value
Range(ReturnAddress).Value = Close1
Next

I have above:
Dim Date1 as Date

But when I try and set it fails with:
Set Date1 = ActiveCell.Offset(-2, 0).Value

So I changed it and did not set it:
Date1 = ActiveCell.Offset(-2, 0).Value

I am not sure what I am missing at this point, since I treid to Set it and
then tried not setting it.

Thanks,
--
David


p45cal[_239_]

Object not set
 

FSt1;685232 Wrote:

hi
try...
set selection.find(what:=etc,etc,etc

Regards
FSt1

"David" wrote:

Hi Group,

Hope all are having a good day. The code has this object not set:

For i = 1 To 4
Selection.Find(What:=" & (Date1) & ", After:=ActiveCell,
LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByColumns,

SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Close1 = ActiveCell.Offset(0, 4).Value
Range(ReturnAddress).Value = Close1
Next

I have above:
Dim Date1 as Date

But when I try and set it fails with:
Set Date1 = ActiveCell.Offset(-2, 0).Value

So I changed it and did not set it:
Date1 = ActiveCell.Offset(-2, 0).Value

I am not sure what I am missing at this point, since I treid to Set

it and
then tried not setting it.

Thanks,
--
David





Which line is highlighted in this error?


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: 558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=191489

http://www.thecodecage.com/forumz



All times are GMT +1. The time now is 11:44 PM.

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