I have a data table that has values in column A consisting of whole integers and some decimal numbers. (e.g. 1; 2; 3; 3.1; 3.2; 4... etc). I am trying to loop thru column A, find any values that are not whole numbers and delete that entire row.
I am attempting to use the Mod function to do this, so I am taking the value of the cell in column A and when dividing that by 1, if the remainder is not zero delete the row.
For some reason, my remainder is always being set at zero with this code below, even when doing 10.1 Mod 1 for example. Can anyone tell me what I have wrong. Thanks.
Dim c As Range
Dim remainder As Variant
Dim rowNum As Integer
For Each c In Worksheets("BOM Dump").Range("A1:A1000").Cells
'Range("L1").Value = "Number"
'Range("M1").Value = c
remainder = c.Value Mod 1
Range("N2").Value = remainder
If remainder <> 0 Then
rowNum = c.Row
Rows(rowNum).EntireRow.Delete
End If
Next