Mark_Annonyous
New Member
- Joined
- May 9, 2020
- Messages
- 20
- Office Version
- 365
- Platform
- Windows
HI,
I hope everyone i staying clear of the storms that are hammering the U.S. ( for those of you who live there)
As the title suggests, i am looking for a push in the right direction to convert the below code into to something more binary. Rather than summing the result, i want a 1 or 0.
I've tried putting a application.max function but it just errors out.
I hope everyone i staying clear of the storms that are hammering the U.S. ( for those of you who live there)
As the title suggests, i am looking for a push in the right direction to convert the below code into to something more binary. Rather than summing the result, i want a 1 or 0.
I've tried putting a application.max function but it just errors out.
VBA Code:
For ColumnCounter = 5 To 1099
Exportdate = alldata(1, ColumnCounter)
For RowCounter = 2 To LastRowSummary
ExShipCount = 0
VesselName = alldata(RowCounter, 1) 'For each cell being evaluated, we need to store the Export country in column 1 to be evaluated.
For DataImportCounter = 1 To LastRowDataImport
If Reutdata(DataImportCounter, 29) = 1 Then
If Reutdata(DataImportCounter, 1) = VesselName Then
If Exportdate >= Reutdata(DataImportCounter, 31) And Exportdate <= Reutdata(DataImportCounter, 32) Then
ExShipCount = ExShipCount + 1
End If
End If
End If
Next DataImportCounter
output1(RowCounter - 1, ColumnCounter - 4) = ExShipCount
Next RowCounter
Next ColumnCounter
Range(.Cells(2, 5), .Cells(LastRowSummary, 1099)) = output1
Last edited by a moderator: