moiishchiu
05-11-2016, 06:26 PM
Its a very long program, so this is just a part where it does not appear in the cell, also what does this mean as in delta. Im using another persons code to automate a new worksheet so im not very sure what it means.
Its not complete but I just want to make sure that at least a value is appearing in the cells I assigned it to. Its at the bottom of the coding.
DELTA = Sheets("Summary").Rows(4).Find(What:=strSearch, LookIn:=xlValues, lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, searchformat:=False).Column
Dim LCMSsqQTYnew As Integer
Dim LCMSsqDollarnew As Integer
Dim LCMSqqqQTYnew As Integer
Dim LCMSqqqDollarnew As Integer
Dim LCMStofQTYnew As Integer
Dim LCMStofDollarnew As Integer
Dim LCMSqtofQTYnew As Integer
Dim LCMSqtofDollarnew As Integer
Dim LCMSancilDollarnew As Integer
Dim AAScustQTYnew As Integer
Dim AAScustDollarnew As Integer
Dim AASinstQtynew As Integer
Dim AASinstDollarnew As Integer
Dim AASconsDollarnew As Integer
Dim AASencoreQtynew As Integer
Dim AASencoreDollarnew As Integer
Dim AASrfQtynew As Integer
Dim AASrfDollarnew As Integer
For counter2 = 4 To lengthoflist - 1 'means row 4 count down as a loop (keep adding)
If Cells(counter2, shipDate) <> "N/A" Then 'why not equal to "n/a"
If Cells(counter2, 6) = "LCMS_SQ" Then
If Cells(counter2, 8) = "NEW" Then
LCMSsqQTYnew = LCMSsqQTYnew + Cells(counter2, 4)
LCMSsqDollarnew = LCMSsqDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "LCMS_QQQ" Then
If Cells(counter2, 8) = "NEW" Then '(might be else if?)
LCMSqqqQTYnew = LCMSqqqQTYnew + Cells(counter2, 4)
LCMSqqqDollarnew = LCMSqqqDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "LCMS_TOF" Then
If Cells(counter2, 8) = "NEW" Then
LCMStofQTYnew = LCMStofQTYnew + Cells(counter2, 4)
LCMStofDollarnew = LCMStofDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "LCMS_Q-TOF" Then
If Cells(counter2, 8) = "NEW" Then
LCMSqtofQTYnew = LCMSqtofQTYnew + Cells(counter2, 4)
LCMSqtofDollarnew = LCMSqtofDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "LCMS - Others" Or Cells(counter2, 6) = "LCMS - Sources" Then
If Cells(counter2, 8) = "NEW" Then
LCMSancilDollarnew = LCMSancilDollar + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "V1 - Custom" Then
If Cells(counter2, 8) = "NEW" Then
AAScustQTYnew = AAScustQTYnew + Cells(counter2, 4)
AAScustDollarnew = AAScustDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "V1 - Instrument" Then
If Cells(counter2, 8) = "NEW" Then
AASinstQtynew = AASinstQtynew + Cells(counter2, 4)
AASinstDollarnew = AASinstDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "V1 - Consumables" Then
If Cells(counter2, 8) = "NEW" Then
AASconsDollarnew = AASconsDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "V1 - Encore" Then
If Cells(counter2, 8) = "NEW" Then
AASencoreQtynew = AASencoreQtynew + Cells(counter2, 4)
AASencoreDollarnew = AASencoreDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "V1 - RapidFire" Then
If Cells(counter2, 8) = "NEW" Then
AASrfQtynew = AASrfQtynew + Cells(counter2, 4)
AASrfDollarnew = AASrfDollarnew + Cells(counter2, shipUSD)
End If
End If
End If
Next counter2
Cells(5, DELTA - 2) = LCMSsqQTYnew
Its not complete but I just want to make sure that at least a value is appearing in the cells I assigned it to. Its at the bottom of the coding.
DELTA = Sheets("Summary").Rows(4).Find(What:=strSearch, LookIn:=xlValues, lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, searchformat:=False).Column
Dim LCMSsqQTYnew As Integer
Dim LCMSsqDollarnew As Integer
Dim LCMSqqqQTYnew As Integer
Dim LCMSqqqDollarnew As Integer
Dim LCMStofQTYnew As Integer
Dim LCMStofDollarnew As Integer
Dim LCMSqtofQTYnew As Integer
Dim LCMSqtofDollarnew As Integer
Dim LCMSancilDollarnew As Integer
Dim AAScustQTYnew As Integer
Dim AAScustDollarnew As Integer
Dim AASinstQtynew As Integer
Dim AASinstDollarnew As Integer
Dim AASconsDollarnew As Integer
Dim AASencoreQtynew As Integer
Dim AASencoreDollarnew As Integer
Dim AASrfQtynew As Integer
Dim AASrfDollarnew As Integer
For counter2 = 4 To lengthoflist - 1 'means row 4 count down as a loop (keep adding)
If Cells(counter2, shipDate) <> "N/A" Then 'why not equal to "n/a"
If Cells(counter2, 6) = "LCMS_SQ" Then
If Cells(counter2, 8) = "NEW" Then
LCMSsqQTYnew = LCMSsqQTYnew + Cells(counter2, 4)
LCMSsqDollarnew = LCMSsqDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "LCMS_QQQ" Then
If Cells(counter2, 8) = "NEW" Then '(might be else if?)
LCMSqqqQTYnew = LCMSqqqQTYnew + Cells(counter2, 4)
LCMSqqqDollarnew = LCMSqqqDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "LCMS_TOF" Then
If Cells(counter2, 8) = "NEW" Then
LCMStofQTYnew = LCMStofQTYnew + Cells(counter2, 4)
LCMStofDollarnew = LCMStofDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "LCMS_Q-TOF" Then
If Cells(counter2, 8) = "NEW" Then
LCMSqtofQTYnew = LCMSqtofQTYnew + Cells(counter2, 4)
LCMSqtofDollarnew = LCMSqtofDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "LCMS - Others" Or Cells(counter2, 6) = "LCMS - Sources" Then
If Cells(counter2, 8) = "NEW" Then
LCMSancilDollarnew = LCMSancilDollar + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "V1 - Custom" Then
If Cells(counter2, 8) = "NEW" Then
AAScustQTYnew = AAScustQTYnew + Cells(counter2, 4)
AAScustDollarnew = AAScustDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "V1 - Instrument" Then
If Cells(counter2, 8) = "NEW" Then
AASinstQtynew = AASinstQtynew + Cells(counter2, 4)
AASinstDollarnew = AASinstDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "V1 - Consumables" Then
If Cells(counter2, 8) = "NEW" Then
AASconsDollarnew = AASconsDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "V1 - Encore" Then
If Cells(counter2, 8) = "NEW" Then
AASencoreQtynew = AASencoreQtynew + Cells(counter2, 4)
AASencoreDollarnew = AASencoreDollarnew + Cells(counter2, shipUSD)
End If
ElseIf Cells(counter2, 6) = "V1 - RapidFire" Then
If Cells(counter2, 8) = "NEW" Then
AASrfQtynew = AASrfQtynew + Cells(counter2, 4)
AASrfDollarnew = AASrfDollarnew + Cells(counter2, shipUSD)
End If
End If
End If
Next counter2
Cells(5, DELTA - 2) = LCMSsqQTYnew