MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Using Lookup Tables

Posted by Josh on January 15, 2002 2:53 PM

Another question for you guys-n-gals out there. I'm trying to make a UserForm that takes a number you input, checks a worksheet for a matching number, and then adds data to another worksheet that corresponds to the number looked up. I have no idea where to start...

for example,

you put 5 in the textbox on the userform and press the commandbutton. on sheet2, in the first avaliable row,it outputs "5 Golden Rings".

Thanks as always...

Posted by Damon Ostrander on January 16, 2002 9:50 AM

Hi Josh,

Okay, let's say your textbox is named TextBox1. In your commandbutton Click event, you would just need the code:

Worksheets("Sheet2").[A65536].End(xlUp).Offset(1).Value = TextBox1.Text & " Golden Rings"

This assumes you want the value in column A in the first available row.