Writing VBA macro for generating missing variable

ryan8200

Active Member
Joined
Aug 21, 2011
Messages
357
Hello members,

I would like to write VBA macro for listing the missing variables as per below.

Among candidates A, B C, D and E. I would like to list down the missing variables (Hobbies), accompanied by the candidates name.

HobbiesABCDE
SwimmingYYYNN
TennisNYYYN
BadmintonNNYYY
VolleyballYNNYN

<tbody>
</tbody>

The expected outcome will be looked like as below:


Hobbies Candidate
TennisA
BadmintonA
Badminton B
VolleyballB
Volleyball
<strike></strike>
C
SwimmingD
SwimmingE
TennisE
VolleyballE

<tbody>
</tbody>


Your kind assistance is greatly appreciated.

Many thanks.

Regards,
Ryan
 
If you modified the existing macro, post your version now and I'll show you how to place the headers on.

Basically, from my original macro, you want to use something like:

Code:
Cells(7, 1) = "Hobbies"
Cells(7, 2) = "Candidate"

Always happy to help!

Kevin
 
Last edited:
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
If you modified the existing macro, post your version now and I'll show you how to place the headers on.

Basically, from my original macro, you want to use something like:

Code:
Cells(7, 1) = "Hobbies"
Cells(7, 2) = "Candidate"

Always happy to help!

Kevin


Thanks for the help. How to amend the code so that the output will be displayed at new worksheet instead of existing worksheet
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,454
Members
448,898
Latest member
drewmorgan128

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