Form Macro problem - wont return values

Showard27

Board Regular
Joined
Sep 5, 2005
Messages
155
Help

I have recreated the macro as described on pages 171 to 172, Ch 9 of VBA & Macros for MS Excel. The code for when the user changes from selecting a value in the "ListBox1", to selecting "TextBox1", basically looks like this.

Private Sub TextBox1_GotFocus()
Dim IngFound As Range
With Range("IngList")
Set IngFound = .Find(ListBox1.Value)
With Range(IngFound.Address)
TextBox2 = .Offset(0, 3)
End With
End With
End Sub

This basically looks up the selected value "IngFound" with "ListBox1", from within a defined range "IngList" on a worksheet. It then should update "TextBox2" with the value 3 cells to the right of the found value.

All Feautres here are on the same userform. I have tried the process as Click() as well as GotFocus(), but both without success. I have also tried turning TextBox2 into a label, but again this has no effect.

The "IngList" range is arranged in colums, and four colums wide. from my understanding this process is attempting to mimic the vlookup process from within excel, but I cannot get it to go.

I am running Excel 2000, and VB6, and hoping that this is not a version issue. I look forward to any help anyone can give.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,215,537
Messages
6,125,386
Members
449,221
Latest member
DFCarter

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top