VBA evaluate, lookup and paste into comment field

DutchKevin

Board Regular
Joined
Apr 13, 2011
Messages
133
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I'm not brand new to VBA but for me this is overcomplex.
Hope you can help in this case.

I would like to create a macro which does the following to a column of dates:
For each cell in the column/range it should check if the date in that cell is present in a named range (Bdays) on sheet2.
Named Range Bdays has 3 columns, one with actual birthdates (01-Jan-1980), one with the name (John) and one with their next birthday (01-Jan-2012).
If the match is TRUE, then it should present the lookup-name into a comment of this cell.
In this example you would find "John" in the comment of the cell containing the date: 01-Jan-2012.

Existing comments should in best case be merged with the lookup name. If that's not possible, existing comments should be kept as is.
Dates in the range that have no match in Bdays should not get a comment.

I know it's a long wishlist and I hope I've explained myself clear enough.
I look forward to your reactions/sollutions.

Kevin
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Re: VBA lookup and paste into comment field

Hi everybody,
Let me break up the question then.
How would code work that does the lookup in a seperate range?
How would i write code that then judges to perform an action or not?

The rest I'll try to figure out from that.

Regards
Kevin
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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