Vlookup function in VBA

IJ_Alducente

New Member
Joined
Jan 12, 2017
Messages
3
Please help me...

Here's what I'm working on right now.

Sheet #1 has:
Company Code, Account Number, and Customer Name
Sheet #2 has:
Company Code, Account Number, and Customer Name

Both sheets have the same data except that in Sheet #1 under the Company Code column the cells show "ABC", "DEF", "GHI"

Sheet #2 is where my Table array is and under the Company Code column of Sheet #2 it says "ABC-1", "ABC-2", "DEF", "GHI"

I want to change "ABC" in Sheet #1 to either "ABC-1" or "ABC-2" depending on the value in the cells under the column Account number using the Vlookup function.
Note: The values under the column Account number in Sheet #1 is my Lookup Value


My problem is:

When I do a Vlookup in VBA, the Vlookup function has to be in a specific cell only and the problem with that is that the number of rows I occupy in Sheet #1 varies in a daily basis.
How do I do a Vlookup using VBA only for the cells in Sheet #1 where the Company Code only says "ABC"?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
You sent me a PM to answer your question. I am not very good at VBA so unfortunately I can not help you here.
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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