rjwebgraphix
Well-known Member
- Joined
- May 25, 2010
- Messages
- 590
Is there a way to find something that is not equal to a value or is the best bet still this looped if statement?
I'm primarily talking about this section....
Just with 16000 rows, it takes a while and looking for a faster way.
Thanks
Code:
Dim HdrRng As Range
Dim BadFile As Boolean
Dim MixedPlnt As Boolean.
Set HdrRng = Rows("4:4")
Set PlntFound = HdrRng.Find("Plnt", [A4], , xlWhole, xlByColumns, xlPrevious)
If Not PlntFound Is Nothing Then
PlntCol = HdrRng.Find("Plnt", [A4], , xlWhole, xlByColumns, xlPrevious).Column
lrow = 6
Do While Cells(lrow, PlntCol) <> ""
Cells(lrow, PlntCol).Value = RTrim(Cells(lrow, PlntCol))
If Cells(lrow, PlntCol) <> 520 Or Cells(lrow, PlntCol) <> 520 Then
MixedPlnt = True
Exit Do
End If
lrow = lrow + 1
Loop
Else
BadFile = True
End If
I'm primarily talking about this section....
Code:
Do While Cells(lrow, PlntCol) <> ""
Cells(lrow, PlntCol).Value = RTrim(Cells(lrow, PlntCol))
If Cells(lrow, PlntCol) <> 520 Then
MixedPlnt = True
Exit Do
End If
lrow = lrow + 1
Loop
Just with 16000 rows, it takes a while and looking for a faster way.
Thanks