Interesting - Send gifts to members :)

ellen12

New Member
Joined
May 10, 2012
Messages
7
Hi everyone I would like to seek your help in doing a macro. I have four sheets:

  1. The first one is a list of all members and their score.
  2. Sheet 2 is populated as users fill a optin form on our website. They'll be registering for a free gift which will be sent to them on scoring more than 100.
  3. Sheet 3 will be empty and will be filled up by the macro.
  4. Sheet 4 is the list of members to whom the gift email has been sent.
I want to send the gift email to the opted members who scored more than 100.

My idea is:
  • Macro must first, check if the usernames listed in sheet 2, have scored greater or equal to 100 (in sheet 1).
  • Then, check if the username/email is not already listed in sheet 4.
  • Finally once the above two conditions are met, copy the filtered rows to 3rd & 4th sheet.

I will send the gift to emails listed in sheet 3 and clear the sheet. Both sheet 1 & 2 will will be updated frequently and emails will be sent after each update.

EXAMPLE:

Sheet 1 (Main database)
Book1
AB
1UsernameScore
2a150
3b40
4c90
5d100
6e110
7f105
Sheet1


Sheet 2 (Optin form: Users who have registered for a free gift which will be sent to them on scoring more than 100.)
Book1
AB
1UsernameEmail
2aa@xyz.com
3bb@xyz.com
4dd@xyz.com
5ee@xyz.com
6zz@xyz.com
Sheet1


Sheet 3 (Outbox: Gifts must be sent to these members. This list will be cleared once emails are sent.)
Book1
AB
1UsernameEmail
2
Sheet1


Sheet 4 (Sent Emails: List of members who received the gift.)
Book1
AB
1UsernameEmail
2aa@xyz.com
Sheet1


Macro Result:

Sheet 3
Book1
AB
1UsernameEmail
2dd@xyz.com
3ee@xyz.com
Sheet1


Sheet 4 (d & e are newly added)
Book1
AB
1UsernameEmail
2aa@xyz.com
3dd@xyz.com
4ee@xyz.com
Sheet1


If anyone has a better idea to simplify the process, please share.
Please help me with this, I will be thankful to you forever.
 

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.
There seems to be one information you have forgotten to mention.

Sheet4 needs to have record of people you already have sent gifts to, so how will the macro recognize the gift has been sent? If sending gift cannot be electronically recognized, you would need to do some manual work :P

But filling up sheet3 won't be a problem.

Lastly, one suggestion would be to merge Sheet1 with Sheet2. So that you have 3 columns consisting of {Username, Score, Email} and have a system where you would put "N/A" for people who haven't filled in their emails. This way, it's easier for human to read and computer to process (less resources needed)
 
Upvote 0
I think you could do this on one sheet with something like this. The red cells are users owed a gift. Put an x in the red cells when the gift is sent.
Excel Workbook
ABCD
1UsernameScoreRegistered EmailGifted
2a150a@xyz.comx
3b40b@xyz.com
4c90c@xyz.com
5d100d@xyz.com
6e110e@xyz.com
7f105
8zz@xyz.com
Sheet
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D21. / Formula is =AND(B2>=100,C2<>"",D2="")Abc
D31. / Formula is =AND(B3>=100,C3<>"",D3="")Abc
D41. / Formula is =AND(B4>=100,C4<>"",D4="")Abc
D51. / Formula is =AND(B5>=100,C5<>"",D5="")Abc
D61. / Formula is =AND(B6>=100,C6<>"",D6="")Abc
D71. / Formula is =AND(B7>=100,C7<>"",D7="")Abc
D81. / Formula is =AND(B8>=100,C8<>"",D8="")Abc
 
Upvote 0
There seems to be one information you have forgotten to mention. Sheet4 needs to have record of people you already have sent gifts to, so how will the macro recognize the gift has been sent?

I haven't sent emails to anyone yet. I will start sending once the macro is ready.

Lastly, one suggestion would be to merge Sheet1 with Sheet2. So that you have 3 columns consisting of {Username, Score, Email} and have a system where you would put "N/A" for people who haven't filled in their emails. This way, it's easier for human to read and computer to process (less resources needed)

How can I merge them?
 
Last edited:
Upvote 0
I think you could do this on one sheet with something like this. The red cells are users owed a gift. Put an x in the red cells when the gift is sent.

Okay. The opted list and the full member list will be on separate sheets. How to merge them (sheet 1 & 2)?
 
Upvote 0
Okay. The opted list and the full member list will be on separate sheets. How to merge them (sheet 1 & 2)?

Sheet1 (Member list with scores and merged data with Sheet2)
Excel Workbook
ABCD
1UsernameScoreRegistered EmailGifted
2a150a@xyz.comx
3b40b@xyz.com
4c90 
5d100d@xyz.com
6e110e@xyz.com
7f105 
8zz@xyz.com
Sheet
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D21. / Formula is =AND(B2>=100,C2<>"",D2="")Abc
D31. / Formula is =AND(B3>=100,C3<>"",D3="")Abc
D41. / Formula is =AND(B4>=100,C4<>"",D4="")Abc
D51. / Formula is =AND(B5>=100,C5<>"",D5="")Abc
D61. / Formula is =AND(B6>=100,C6<>"",D6="")Abc
D71. / Formula is =AND(B7>=100,C7<>"",D7="")Abc
D81. / Formula is =AND(B8>=100,C8<>"",D8="")Abc
Sheet2 (Opted List)
Excel Workbook
AB
1UsernameEmail
2aa@xyz.com
3bb@xyz.com
4dd@xyz.com
5ee@xyz.com
6zz@xyz.com
7
Sheet
 
Upvote 0

Forum statistics

Threads
1,215,187
Messages
6,123,540
Members
449,107
Latest member
caya

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