ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Object required, fault 'No 424' (https://www.excelbanter.com/excel-programming/364792-object-required-fault-no-424-a.html)

april27

Object required, fault 'No 424'
 
Hi. I am trying to make a loop in which I want to search for 1) The word
"Date" 2) If this is found I want to check the cells in the same column but
different rows than "Date". This is to check where the list ends. However
when doing this check I want to compare a predefined value (found in
startDatumArr(1)) with the values in the cells that I am checking. If this
"match" is found I want to be able to get address of the cell that
corresponds to the predefined value. However, when looping I get an error
message saying: 'Object required' Fault No 424. What does it mean and how do
I solve it? (rng1 is defined as Range and startDatumArr(1) as Variant).
Please please help me. Any assistance is very much appreciated!!!

Set rng1 = Worksheets("Indata").Cells.Find("Date", LookIn:=xlValues)
Set rng2 = Worksheets("Indata").Cells.Find("QC", LookIn:=xlValues)

If rng1 Is Nothing Then
MsgBox ("Date cannot be found!")
Else
i = 0
Do Until IsEmpty(rng1.Offset(i + 1, 0)) = True

If rng.Offset(i + 1, 0) = startDatumArr(1) Then
strTeststartDatumAddress = rng.Offset(i + 1, 0).Address
i = i + 1
Else
i = i + 1
End If
Loop

Norman Jones

Object required, fault 'No 424'
 
Hi April27,

strTeststartDatumAddress = rng.Offset(i + 1, 0).Address


You have not set the rng variable to a range.

I have not sought to understand your code, but perhaps rng was intended as
rng1?


---
Regards,
Norman



"april27" wrote in message
...
Hi. I am trying to make a loop in which I want to search for 1) The word
"Date" 2) If this is found I want to check the cells in the same column
but
different rows than "Date". This is to check where the list ends. However
when doing this check I want to compare a predefined value (found in
startDatumArr(1)) with the values in the cells that I am checking. If this
"match" is found I want to be able to get address of the cell that
corresponds to the predefined value. However, when looping I get an error
message saying: 'Object required' Fault No 424. What does it mean and how
do
I solve it? (rng1 is defined as Range and startDatumArr(1) as Variant).
Please please help me. Any assistance is very much appreciated!!!

Set rng1 = Worksheets("Indata").Cells.Find("Date", LookIn:=xlValues)
Set rng2 = Worksheets("Indata").Cells.Find("QC", LookIn:=xlValues)

If rng1 Is Nothing Then
MsgBox ("Date cannot be found!")
Else
i = 0
Do Until IsEmpty(rng1.Offset(i + 1, 0)) = True

If rng.Offset(i + 1, 0) = startDatumArr(1) Then
strTeststartDatumAddress = rng.Offset(i + 1, 0).Address
i = i + 1
Else
i = i + 1
End If
Loop





All times are GMT +1. The time now is 12:05 AM.

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