hellfire45
Active Member
- Joined
- Jun 7, 2014
- Messages
- 464
So I have a spreadsheet where I need to capture the rows with values that are less than $1 in a specific column.
In the spreadsheet a number of rows say $0.80 in said column which means it needs to be captured.
The below code runs through every line in the spreadsheet and amongst other things captures the CHG_AMT which is the variable I spoke up. Then below it says ElseIf CHG_AMT < 1 Then, do something. However, the CHG_AMT is being captured in the locals window as 1.
I tried using variant, double, using Round(blah blah, 2), and nothing has worked. Any ideas guys? Thank you very kindly.
In the spreadsheet a number of rows say $0.80 in said column which means it needs to be captured.
The below code runs through every line in the spreadsheet and amongst other things captures the CHG_AMT which is the variable I spoke up. Then below it says ElseIf CHG_AMT < 1 Then, do something. However, the CHG_AMT is being captured in the locals window as 1.
I tried using variant, double, using Round(blah blah, 2), and nothing has worked. Any ideas guys? Thank you very kindly.
Code:
For X_ROW = 2 To LAST_ROW On Error GoTo nextfile:
Application.StatusBar = "Parsing Data: " & Format(X_ROW / WorksheetFunction.CountA(.Columns(DEV_ID)), "0.0%")
CHG_AMT = Round(.Cells(X_ROW, CHARGE_AMT).Value, 2)
CUSTOMER = .Cells(X_ROW, CUST_NAME).Value
DEVICE_ID = .Cells(X_ROW, DEV_ID).Value
BLACKLIST_CUSTOMER = WorksheetFunction.IfError(Application.Match(CUSTOMER, BLACK_LIST, 0), 0)
PAST_ITEM_CHECK = WorksheetFunction.IfError(Application.Match(DEVICE_ID, PAST_ITEMS, 0), 0)
If X_ROW > 1348 Then
MsgBox "Stop"
End If
If PAST_ITEM_CHECK > 0 Then
Prev_List_LR = Prev.Columns(DEV_ID).Find("*", , , , xlRows, xlPrevious).Row
.Rows(X_ROW).Copy Destination:=Prev.Rows(Prev_List_LR + 1)
[B] ElseIf CHG_AMT < 1 Then[/B]
Under_One_LR = UnderONE.Columns(DEV_ID).Find("*", , , , xlRows, xlPrevious).Row