D
Darren \(at work\)
Hi,
I have a column in which the number of rows will always change. What i
need to do is determine the Row number in which the last value is placed.
The code I am using, for testing, is this:
====Begin Code=========================
'--Loop down through all entries for "Fault Type"
For i = 2 To 85
'--Number of item inspected. Those with more than one fault,
'--The item number will be in a merged cell, the value sitting in the
'--topmost cell. If there are any rows with an Item number missing
'--then do not take the corresponding fault type from respective column.
If Cells(i, 8).Value <> "" Then
Select Case Cells(i, 10).Value
Case "Paint Fault"
intPaintFault = intPaintFault + 1
Case "Misc"
intMisc = intMisc + 1
Case "Scratch"
intScratch = intScratch + 1
Case "Plastic Sheild"
intPlasticShield = intPlasticShield + 1
Case "Dent", "Indent"
intDents = intDents + 1
Case "Paint Chip"
intPaintChip = intPaintChip + 1
Case "Bent"
intBent = intBent + 1
End Select
End If
Next i
====End Code==========================
What I need for the top limit of the for loop is the row number of the
bottom most cell with a vlue in it, as oposed to an absolute number.
Hope this makes sense.
Best Regards
Darren
I have a column in which the number of rows will always change. What i
need to do is determine the Row number in which the last value is placed.
The code I am using, for testing, is this:
====Begin Code=========================
'--Loop down through all entries for "Fault Type"
For i = 2 To 85
'--Number of item inspected. Those with more than one fault,
'--The item number will be in a merged cell, the value sitting in the
'--topmost cell. If there are any rows with an Item number missing
'--then do not take the corresponding fault type from respective column.
If Cells(i, 8).Value <> "" Then
Select Case Cells(i, 10).Value
Case "Paint Fault"
intPaintFault = intPaintFault + 1
Case "Misc"
intMisc = intMisc + 1
Case "Scratch"
intScratch = intScratch + 1
Case "Plastic Sheild"
intPlasticShield = intPlasticShield + 1
Case "Dent", "Indent"
intDents = intDents + 1
Case "Paint Chip"
intPaintChip = intPaintChip + 1
Case "Bent"
intBent = intBent + 1
End Select
End If
Next i
====End Code==========================
What I need for the top limit of the for loop is the row number of the
bottom most cell with a vlue in it, as oposed to an absolute number.
Hope this makes sense.
Best Regards
Darren