Hi,
I have written VBA code in Excel that runs down a column
comparing the number in each cell with the value in a
combo button e.g.
Sheets("lookuporder").Range("A2").Activate
For Each Cell In Range("colOrderNo")
Dim OrderNo As Integer
OrderNo = cmbOrderNo.Value
' but the value selected in the above combo is read as a text character e.g. "3" so even if the Number in Cell is
the same as Number in Combo nothing will happen.I have tried formatting the Cells as Whole Number but get same poblem
If ActiveCell.Value <> OrderNo Then
ActiveCell.Offset(1, 0).Activate
If ActiveCell.Value = -1 Then
Exit For
End If
End If
Please can any on help
I have written VBA code in Excel that runs down a column
comparing the number in each cell with the value in a
combo button e.g.
Sheets("lookuporder").Range("A2").Activate
For Each Cell In Range("colOrderNo")
Dim OrderNo As Integer
OrderNo = cmbOrderNo.Value
' but the value selected in the above combo is read as a text character e.g. "3" so even if the Number in Cell is
the same as Number in Combo nothing will happen.I have tried formatting the Cells as Whole Number but get same poblem
If ActiveCell.Value <> OrderNo Then
ActiveCell.Offset(1, 0).Activate
If ActiveCell.Value = -1 Then
Exit For
End If
End If
Please can any on help