LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default lookup for a combo box in VBA

Ok, thanks to Patrick I have my combo box working. Of coarse there is a but,
the
combo box returns a number in the database. Do I have to write a function
in the macro to
lookup the correct text? I have used vlookup in excel but never in a macro.
Help please! Right now in column 4 and 5 there is number instead of the
vendors name and ranch name.

This is what it looks like thus far:

Private Sub cmdAdd_Click()

' copy the data to the database
ws.Cells(iRow, 1).Value = "=R[-1]C+1"
ws.Cells(iRow, 2).Value = Me.txtInvoice.Value
ws.Cells(iRow, 3).Value = Me.txtDate.Value
ws.Cells(iRow, 4).Value = Me.cboVend.Value
ws.Cells(iRow, 5).Value = Me.cboRan.Value
ws.Cells(iRow, 7).Value = Me.txtPallet.Value
ws.Cells(iRow, 8).Value = Me.txtQty.Value
ws.Cells(iRow, 10).Value = Me.txtRepakHrs.Value
ws.Cells(iRow, 11).Value = Me.txtRepakQty.Value
ws.Cells(iRow, 12).Value = "Purchase"
Me.txtInvoice.SetFocus

End Sub





--
Though daily learning, I LOVE EXCEL!
Jennifer
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lookup on a combo box dp_amsafe_elkhart Excel Worksheet Functions 1 March 23rd 10 04:37 PM
combo boxes and lookup Addz New Users to Excel 7 July 30th 05 11:36 PM
Combo Box lookup CEN7272 - ExcelForums.com Excel Programming 2 January 27th 05 06:40 PM
COmbo box and lookup list G Lam[_2_] Excel Programming 2 November 14th 04 03:21 PM
Combo Box wrong lookup range. Pal Excel Programming 2 February 28th 04 08:04 PM


All times are GMT +1. The time now is 01:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"