View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Yet Another VLOOKUP issue in VBA

TruckCap = Application.VLookup(truck.Value, CapRange, 8, False)


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Bill" wrote in message
...
Anyone know what I am doing wrong?
Here is a snip of my code:

' Calculate Yardage
Set CapRange = Worksheets("TruckInfo").Range("TruckData")
Set truck = Me.cboTruckID
Set PerFull = Me.txtPerCap

TruckCap = Application.VLookup(truck, CapRange, 8, False)

vTruckYard = TruckCap * PerFull

The "truck" variable is getting set correctly (long type)
The "PerFull" variable is getting set correctly (long type)
The code hangs-up with the Vlookup segment ("Type mismatch")

Is there a special way to pass parameters to VLOOKUP inside of VBA?

Help?