Hello,
I got an issue with my "on error go to" statement.
My code looks pretty much like this:
Dim NbrOfBrands as long
Dim counter as long
Dim Mybrand() as variant
(I populate MyBrand somewhere using the redim statement)
For counter = 1 to NbrOfBrands
'If the listed product is not in the sheet, I want to jump to the next one (so skip everything until the next statement)
On Error GoTo ContinueNextProduct
Cells.Find(what:=MyBrand(counter, 1)).Activate
On Error GoTo 0
' Do some stuff
ContinueNextProduct:
next counter
This goes right once
I skip one of the products that is not in the list, but the second one gives me an error "Object variable or With block variable not set"
Anyone knows what I'm doing wrong?
Regards,
Mikey
I got an issue with my "on error go to" statement.
My code looks pretty much like this:
Dim NbrOfBrands as long
Dim counter as long
Dim Mybrand() as variant
(I populate MyBrand somewhere using the redim statement)
For counter = 1 to NbrOfBrands
'If the listed product is not in the sheet, I want to jump to the next one (so skip everything until the next statement)
On Error GoTo ContinueNextProduct
Cells.Find(what:=MyBrand(counter, 1)).Activate
On Error GoTo 0
' Do some stuff
ContinueNextProduct:
next counter
This goes right once
I skip one of the products that is not in the list, but the second one gives me an error "Object variable or With block variable not set"
Anyone knows what I'm doing wrong?
Regards,
Mikey
Last edited: