Hello,
I would like to use VLookup to match the name entered in a userform dialog box to a name in Sheet("CRM_Lib") Column A. Then return the data that is ~20 columns wide from Sheet("CRM_Lib") to Sheet("Header") Cell ("Y42").
For instance the userform asks for a part #. I enter it, then the data for the part (contained in Sheet "CRM_Lib") is placed is Sheet "Header" , Starting at cell "Y42".
Heres an example of what I'm trying
The top row is chemical elements
The next row is the % of a part #.
I currently use a userform to enter a part # in the same row 3 columns to the left and then pastes a vloolup formula across the cells, but I'd like vba to do it with code.
<tbody>
</tbody>
Currently I try
The userform puts the part # in "V42". But I only get the data from the second column. In this case (<0.002). (The part # is the column 1). How to get the whole row?
Thanks
Tom
I would like to use VLookup to match the name entered in a userform dialog box to a name in Sheet("CRM_Lib") Column A. Then return the data that is ~20 columns wide from Sheet("CRM_Lib") to Sheet("Header") Cell ("Y42").
For instance the userform asks for a part #. I enter it, then the data for the part (contained in Sheet "CRM_Lib") is placed is Sheet "Header" , Starting at cell "Y42".
Heres an example of what I'm trying
The top row is chemical elements
The next row is the % of a part #.
I currently use a userform to enter a part # in the same row 3 columns to the left and then pastes a vloolup formula across the cells, but I'd like vba to do it with code.
Al | As | B! | Be | C | Ca! | Co | Cr | Cu | Fe | La | Mg! | Mn | Mo | N! | Nb | Ni | P | Pb | S | Sb | Si | Sn | Ta | Ti | V | W | Zn | Zr |
(<0.002) | -1 | -1 | -1 | 1.06 | -1 | 0.047 | 16.87 | 0.09 | -1 | -1 | -1 | 1.15 | 0.5 | 406 | 0.005 | 0.35 | 0.022 | -1 | 0.007 | -1 | 0.47 | (0.004) | -1 | 0.001 | 0.13 | 0.11 | -1 | -1 |
<tbody>
</tbody>
Currently I try
Code:
Range("Y42") = Application.WorksheetFunction.VLookup _
(Range("V42").Value, Sheets("CRM_Lib").Range("A2:AD2001"), 2, False)
The userform puts the part # in "V42". But I only get the data from the second column. In this case (<0.002). (The part # is the column 1). How to get the whole row?
Thanks
Tom