My question is concerning the runtime error 91 in VBA for excel. I've done some searching to no avail. My code is below. I have noted the section causing the error. Why is this happening, and how can i fix it and move on?
Sub RemoveFooterRows(theFile)
Dim found As Range
Dim aggregateRow
''Error is from section below
found = isItRow = Workbooks(theFile).Worksheets(1).Columns(1).Find _
("Summary", Range("A1"), xlValues, xlPart, xlByRows, xlNext, False, , False)
''Error is from section above
MsgBox ("val is " & found.Row)
End Sub
You need the "Set" keyword to assign the value.
Also not sure what you want " =isItRow =" to do but you should do it in two statements instead of trying to stack them like that.
Also aggregateRow isn't used and isn't assigned a type.
You use SET to find a cell and put it in an object. But you can let SET out if you just waht the Row. This is how I would write that test so far: