LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default vba problem lookup in a matrix

There is another way, but it requires a bit of setup, and it doesn't support
the exit event. If you call a macro, it is just one line.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jean-Pierre D via OfficeKB.com" wrote in message
...
hi Bob,

Just one more question.
i have several txt boxes in the userform.
Each time a txt box is changed i need to execute this code on exit of the

txt
box
do i need to call the sub at each txtbox or is there a better way to do

this?
thanks,
Jean-Pierre

Bob Phillips wrote:
So is this closer

Sub GetVal()
Dim var1 As Long
Dim Var2 As Long
Dim rng As Range
Dim cell As Range
Dim res As Variant
Dim rw As Long, result As Variant
var1 = 31 'replace with real value
Var2 = 32 'replace with real value
For Each rng In Range("A20:A30")
res = InStr(1, rng.Value, " -")
If res 0 Then
Set cell = Worksheets("Data").Range("A4:A53"). _
Find(CLng(Left(rng.Value, res - 1)))
If Not cell Is Nothing Then
result = Worksheets("Data").Cells(cell.Row, cell.Column -

58
+ var1 + Var2)
rng.Offset(0, 2).Value = result
End If
End If
Next rng
End Sub

Hi Bob,

[quoted text clipped - 25 lines]
Thanks,
Pierre



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200509/1



 
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 in a matrix laandmc Excel Discussion (Misc queries) 2 December 13th 09 03:59 PM
Matrix lookup/mulitple criteria lookup MarkFranklin Excel Discussion (Misc queries) 3 March 31st 08 10:15 AM
Matrix Lookup C Brandt Excel Discussion (Misc queries) 4 May 1st 07 05:07 PM
lookup in MATRIX Forumchanin Excel Worksheet Functions 2 December 13th 05 01:29 PM
Lookup in Matrix Johannes Excel Worksheet Functions 5 May 4th 05 10:32 AM


All times are GMT +1. The time now is 03:50 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"