Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime error '424': Object Required | Excel Discussion (Misc queries) | |||
"Microsoft Visual Basic runtime error '424' object required". | Excel Worksheet Functions | |||
Excel 2007 Beta 2 - Macro Run-time error '424' Object required | Excel Programming | |||
Run-time error '424': Object required | Excel Programming | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming |