Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Get a cell value

  Asked By: Geeske    Date: Sep 22    Category: MS Office    Views: 637
  

I need to use a code that acts like the Excel VLOOKUP. I have a number in a text
box that I need to locate in a sheet which contains this number (item number)
description. So, I would like to know how to use this textbox value to find in a
certain column (B) in the sheet the ONLY cell which contains this value, and
then get the content in a range of columns in the same line (the same
comportment of VLOOKUP).
Does anyone know how to do it?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Frederick Greene     Answered On: Sep 22

I think Cell.Find utility of excel  can help you out. Need to do little R&D on
this

 
Answer #2    Answered By: Kelly Bell     Answered On: Sep 22

I reckon the easiest way is to use VLOOKUP still, but have a user
defined function to extract the text from the textbox. Like this:

Function blah()
blah = ActiveSheet.OLEObjects("TextBox1").Object.Text
End Function

To establish the name of the textbox  ("TextBox1" in the function
above) you may have to right click the text box and choose Properties,
and replace 'TextBox1' with whatever yours is called.


Used it a spread sheet  in a cell  by itself it would look like this:
=blah()

Used in the VLOOKUP function it might look like this:
=VLOOKUP(blah(),B12:G18,3,FALSE)

 
Didn't find what you were looking for? Find more on Get a cell value Or get search suggestion and latest updates.




Tagged: