Macro to create comment in cell based on vlookup to cell in another sheet

mpmcarthur

New Member
Joined
Oct 1, 2012
Messages
9
Need help with an Excel macro related to cell comments. I have a workbook with two worksheets. Sheet2 is where I input master data into a table. On Sheet1, I use formulas (mostly vlookup) to present Sheet2 data into a specific format. Overly simplified, this is the format of the two worksheets:

Sheet2 Columns (this is where the list of inventory is entered in a table):

A Stock #
B Make
C Model
D Comment

Sheet1 Columns(this is where the user selects a stock number from a dropdown):

A Stock #


Desired result:
Let's say the user is on Sheet1 cell A2 and selects a stock # from the dropdown (the dropdown list sources from Sheet 2 column A). The macro would identify the selected stock # on Sheet1 cell A2 and then perform a lookup of that stock # on Sheet2. Let's say the lookup locates the matching stock # on Sheet 2 on row 11 (cell A11). Then, the macro would refer to cell D11 to retrieve the comment value related to that stock # and enter it as a comment back on cell A2 on Sheet1. The trigger that causes the macro to run should be anytime there is a change on Sheet2. I know that may sound odd, but keep in mind I've oversimplified how the real workbook actually works in order to minimize the noise in my request for help. When the macro is triggered because of a change on Sheet2, it should run on Sheet1 and "refresh" the comment lookup for all of Col A.

Hope that makes sense. I sincerely appreciate any help offered.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,215,382
Messages
6,124,620
Members
449,175
Latest member
Anniewonder

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