Vba to get related cell values

Azhar0554

New Member
Joined
Oct 16, 2017
Messages
10
Hi Im new to VBA. I have a question below it would helpful if i got the answer

DepartmentSub_IDID
858500_A0100_A
958501_B2001_B
101000_C5000_C
202505_P2005_P

<tbody>
</tbody>

I have the above table for data.I want function/sub to search and get/return the value in Sub_Id and ID based on Department value.

The above table is example i have the sheet with 10000 rows

Thanks in advance
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi, sounds like you want VLOOKUP() for example:


Excel 2013/2016
ABCDEFG
1DepartmentSub_IDIDDepartmentSUB_IDID
2858500_A0100_A958501_B2001_B
3958501_B2001_B
4101000_C5000_C
5202505_P2005_P
Sheet1
Cell Formulas
RangeFormula
F2=VLOOKUP($E2,$A$2:$C$5,2,0)
G2=VLOOKUP($E2,$A$2:$C$5,3,0)
 
Upvote 0

Forum statistics

Threads
1,215,563
Messages
6,125,560
Members
449,237
Latest member
Chase S

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