Arie Bos
Board Regular
- Joined
- Mar 25, 2016
- Messages
- 224
- Office Version
- 365
- Platform
- Windows
Hi everyone,
I have the following code creating an error in the syntax of the "TruckType" argument in the Match function. I am not sure if I should use Val(), Me.() or any argument, all gave me an error.
I have the following code creating an error in the syntax of the "TruckType" argument in the Match function. I am not sure if I should use Val(), Me.() or any argument, all gave me an error.
VBA Code:
Dim TruckType As String
Select Case True
Case optTruckType11: TruckType = "Truck < 10 ton"
Case optTruckType21: TruckType = "Truck 10-20 ton"
Case optTruckType31: TruckType = "Truck > 20 ton"
End Select
Dim CO2PerTruckload As Double
CO2PerTruckload = WorksheetFunction.Index(Range("CO2_TruckWeightWTW"), _
WorksheetFunction.Match(TruckType, Range("CO2_TruckWeight"), 0))