soccerkingpilot
Board Regular
- Joined
- May 21, 2012
- Messages
- 105
Hi Guys,
I'm having a really weird problem right now. I just used a simple for each operation with an if statement wrapped inside and I want to get the corresponding row number for the value that met my condition.
This one's got me scratching my head, and I have a feeling it's something very simple. Any ideas?
Thanks,
Austin
I'm having a really weird problem right now. I just used a simple for each operation with an if statement wrapped inside and I want to get the corresponding row number for the value that met my condition.
Code:
Set MnS = Workbooks("Metrics and Status.xls")
FAlog = Sheets("Critical").Cells(2, 2).Value
Set FAlogS = Workbooks(FAlog).Sheets("Cases")
lastrow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
cllRng = FAlogS.Range("C4", "C" & lastrow)
For Each cll In cllRng
If cll > MnS.Sheets("Critical").Cells(2, 3) Then
firstrow = cll.Row 'This is the line throwing the "Object Required" Error
Exit For
End If
This one's got me scratching my head, and I have a feeling it's something very simple. Any ideas?
Thanks,
Austin