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: 1
Default VLookup (Find & Retrieve) Problem

I'd like to thank everyone for their help. I've been lurking for some time
and always found the answers I needed. I'm sure the solution to my latest
problem is on the board somewhere, but I can't locate it. So I'll ask..

In Excel 2003, what I'd like to do is allow the user to click on a cell to
display a code listing. The list contains the code (1-3 alphanumeric chars)
usually combined with a brief description (1-3 words) (which comes from 2
columns on a separate Worksheet within the same Workbook). Depending on what
type of code is displayed, there may also be an explanation to be displayed
(no more than 30 words). As the user maneuvers through the code listing, the
explanation changes to reflect the code with the focus. At any time, the user
can select the desired code. Once selected, the 1-3 char code is
automatically inserted into the cell that was used to display the code
listing.

Based solely on all the help on the board (and a ginormous amount of
determination), everything works except the following...1) if the user clicks
on any area of the textbox other than the 1-3 char code (i.e. the code
description), an error results, 2) the results of VLookup for the explanation
is one row below the selected associated code chars (i.e. if the user clicks
"P - Pneumatic", VLookup returns "Quarantined means that all ...").

Here is the code I'm using for VLookup...
Private Sub txtInstructions_MouseDown(ByVal Button As Integer, ByVal Shift
As Integer, ByVal X As Single, ByVal Y As Single)

Dim vClarText As Variant
'Selects only the code to lookup.
vClarText = Left(frmInstructions.txtInstructions.SelText, 1)
'Retrieves the code's clarification text and puts it in the clarification
textbox.
frmInstructions.txtClarification.Text = Application.VLookup(vClarText, _
Sheet4.Range("A2:D16"), 4, True)
DoEvents
Me.Repaint
DoEvents
End Sub
 
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
Vlookup and retrieve values 1 row below the normally retrieved val Jon Ratzel[_2_] Excel Worksheet Functions 2 January 20th 10 10:18 PM
Retrieve data with MAX and VLOOKUP Tasha Excel Discussion (Misc queries) 2 August 5th 09 11:15 PM
Vlookup to retrieve a hyperlink Roger on Excel Excel Discussion (Misc queries) 2 November 5th 07 03:46 PM
Can vlookup be used to retrieve multiple matches [email protected] Excel Discussion (Misc queries) 4 August 11th 07 07:20 PM
vlookup doesn't retrieve subscript formatting Why? redmaple98 Excel Discussion (Misc queries) 1 April 28th 06 10:05 PM


All times are GMT +1. The time now is 11:03 PM.

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"