-
On Error GoTo Again: Erase Array
I was looking to solve this issue different initially. Currently I am trying the approach that when an error occurs to skip the error, Erase my array to re-initialize it and resume w/ the next cell in the loop.
I am cross-posting this here from MrExcel-
http://www.mrexcel.com/board2/viewtopic.php?t=286219
If this is a "valid" approach, I am unable to get the sequence of instructions in the correct order. I can get to the Again: or I can get to the next i, but I am unable to Erase the array.
If it is invalid- any advice? I can revert to my original code and run the second If condition, If Not IsNumeric. But I prefer to find a cleaner method than that.
[vba]
For i = 4 To LRowf
For Each Item In Array("BOOT", "BOOTG", "BOOTY", "FTWR", "HAT", "HWBLTS", "HWRISR")
On Error GoTo Again: 'Resume Next
If Cells(i, "F").Value = Item Or Cells(i, "G").Value = Item _
And Cells(i, "M").Value <> Int(Cells(i, "M").Value) Then
Cells(i, "M").NumberFormat = "# ?/?"
On Error GoTo 0
If Not IsNumeric(Cells(i, "M").Value) And Cells(i, "M").NumberFormat = "# ?/?" Then
Cells(i, "M").NumberFormat = "General"
Exit For
End If
End If
Next Item
Next i
Again: Erase Item
[/vba]
my site: www.ecboardco.com
was built w/ a majority of the assistance from the board members here... thanks VBAX.
Just because I see something, doesn't mean that what's actually happening is what I see.
You don't get from 0-90 by standing still!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules