Using Find as shown,
LC20101000000000

would be considered a postitive match for 1010!

Perhaps you need to check potential matches to see if they are actual
matches.

--
Regards,
Tom Ogilvy



"Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
news:%23lk4bwBTFHA.3544@TK2MSFTNGP12.phx.gbl...
> Jason,
>
> One immediate improvement might be to use the Find method, instead of
> stepping through your cells. For example, if you wanted to find your value
> in column C: (with loadcases already defined, as a global array) You can
> add looping ot porcess multiple workbooks: post back if you need help

doing
> that.
>
> Sub Macro1()
>
> Dim myCell As Range
> Dim FirstAddress As String
> Dim mySht As Worksheet
> Dim i As Integer
>
> For Each mySht In ActiveWorkbook.Worksheets
>
> With mySht.Columns("C:C")
> For i = LBound(LoadCases) To UBound(LoadCases)
> Set myCell = .Find(What:=LoadCases(i), _
> LookIn:=xlValues, _
> lookAt:=xlPart)
> If Not myCell Is Nothing Then
> FirstAddress = myCell.Address
> MsgBox myCell.Address & " contains " & LoadCases(i)
> Else
> GoTo NotFound
> End If
>
> Set myCell = .FindNext(myCell)
> If Not myCell Is Nothing And _
> myCell.Address <> FirstAddress Then
> Do
> MsgBox myCell.Address & " contains " & LoadCases(i)
> Set myCell = .FindNext(myCell)
> Loop While Not myCell Is Nothing And _
> myCell.Address <> FirstAddress
> End If
> Next i
> End With
> NotFound:
> Next mySht
> End Sub
>
> HTH,
> Bernie
> MS Excel MVP
>
>
> "Jason Barwig" <barwija@voughtaircraft.com> wrote in message
> news:%23Chgsr0SFHA.2304@tk2msftngp13.phx.gbl...
> > I have a very large excel file full of loadcases with corresponding
> > loads. I am writing some quick code to make my life easier to parse
> > through 30 different excel files one at a time and look for maximum and
> > minimum loads. There are 31 different loadcases and they are not all in
> > each file. So my code open each file, checks to see if the loadcase
> > identifier (the 4 digit code in the array) exists in the file, and if it
> > does then checks for max and mins in 4 different sets of elements
> > looking for the total max and min. There is a lot of data. So the loop
> > I am using is after the file has been opened, the first array value is
> > pulled out and checked against the 4 digit integer I am grabing with the
> > MID function. I need to work my way all the way through the file to
> > make sure it exists. It stops on the first find and then preforms more
> > code which again loops through the rest of the document and checks the
> > max and mins at the other 4 element groups. The total code works just
> > fine if I first assign each array integer to a dummy integer variable.
> > If I only managed to confuse you more I am sorry. Thanks for your help.
> >
> > Jason
> >
> >
> > *** Sent via Developersdex http://www.developersdex.com ***

>
>