szita2000
Board Regular
- Joined
- Apr 25, 2012
- Messages
- 101
- Office Version
- 365
- Platform
- Windows
Hi guys. I can't make this error to go away.
Basically it is part of a loop where first we find a separate table in the bottom of a crystal style report, then we look in the shortened range (ErrorMachinerng)
I get an Object Variable or With block variable not set error on the
NumberOfStops = ErrorMachinerng.Find(What:=MachineToLookfor).Offset(0, 20).Value row
The NumberOfStops is declared as Long, and the data I am trying to get from the table is a Number which I confirmed with a formula.
Let me know if needed I can post the whole code.
Basically it is part of a loop where first we find a separate table in the bottom of a crystal style report, then we look in the shortened range (ErrorMachinerng)
I get an Object Variable or With block variable not set error on the
NumberOfStops = ErrorMachinerng.Find(What:=MachineToLookfor).Offset(0, 20).Value row
The NumberOfStops is declared as Long, and the data I am trying to get from the table is a Number which I confirmed with a formula.
Let me know if needed I can post the whole code.
Code:
TomisRow = searchrange.Find(What:="Tomi Error Evaluation").Row + 5 Debug.Print "Tomisrow = " & TomisRow
Set smallsearchrange = Range("A" & TomisRow & ":A1000")
FindTotalRowBeneathTomi = smallsearchrange.Find(What:="Total").Row - 2
Debug.Print "Total row on the bottom = " & FindTotalRowBeneathTomi
Set ErrorMachinerng = Range("B" & TomisRow + 5 & ":B" & FindTotalRowBeneathTomi)
NumberOfStops = ErrorMachinerng.Find(What:=MachineToLookfor).Offset(0, 20).Value
Debug.Print "Number of stops are: " & NumberOfStops
foundmachineToPaste.Offset(5, (CorrectColumn.Column) - 1).Value = NumberOfStops
Next i