VBA VLOOKUP Help Please

twothings

Board Regular
Joined
Jul 9, 2011
Messages
50
Office Version
  1. 365
Platform
  1. Windows
Hello everyone

I have basic experience with Excel and I have reviewed previous forum posts but can't understand how to adapt vba to my scenario, so seek your assistance please.

Situation
I have a sheet that will be containing a very large amount of data so to assist in reducing file size I am looking for the VBA alternative to having a VLOOKUP prefilling several columns.

This is a working sheet for example to assist my explanation:
http://s000.tinyupload.com/?file_id=39025698863238148574

I have two sheets named Records and Staff.

Staff: Staff ID (Column B2:~), Name (Column C2:~) and Group (Column D2:~).

Records: Where records are added regarding all staff members. When entering the details, the Staff ID number is typed in and the details for name are looked up and represented in the Name column (C7:~) and Group column (D7:~).

I was using vlookup with the following formulas but as stated, when I extend these formulas down the sheet the file size becomes huge and not suitable for my use.

Code:
=IFERROR(VLOOKUP(B7,Staff!B2:D27,2,FALSE),"")

&

=IFERROR(VLOOKUP(B7,Staff!B2:D27,3,FALSE),"")

Thanks in advance :)
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
When you have two separate tables/recordsets that large, that are related by a common field (or fields), what you are describing is really a relational database; something that Access is much better suited to handle than Excel. So, if at all possible, you may want to look at using Access rather than Excel for this.
 
Upvote 0
Hi Joe
Thank you for the suggestion, however I do not have the facility to use Access unfortunately. Im stuck with Excel :)
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,185
Members
449,071
Latest member
cdnMech

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