Need help with VBA code to enter specific content in a fixed number of cells

Excel_Girl

New Member
Joined
Jan 19, 2019
Messages
6
Hi,

Can someone please help me with a VBA code for the following:

1. Suppose I have around 1000-2000 email ids in Column A
2. I need to assign content for eg. "Car" to half of these ids in Column B and "Motorbike" to the other half.

Appreciate any help!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
what does some of the data look like
 
Upvote 0
Excel_Girl,

Welcome to the MrExcel forum.

It is always easier to help and test possible solutions if we could work with your actual file.

Perhaps you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com.

Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here.

Include a detailed explanation of what you would like to do referring to specific cells and worksheets.

If the workbook contains confidential information, you could replace it with generic data.
 
Upvote 0
what does some of the data look like

djajdjajd@gmail.comCar
adkdkdkd@gmail.com
adkdkdkd@gmail.com
adkdkdkd@gmail.com
kda;kdfa;lkdsjf;@gmail.com
dkjfalkdfjalsf@gmail.com
a;ldkjfas;lkdfk@gmail.comTruck
lkdf;lkasjdf@gmail.com
ddkdkakd@gmail.com
akdkdkdk@gmail.com

<tbody>
</tbody>

In Column B, I need to assign content such as "Car" or "Truck". For example, sometime I will need to assign "Car" to 60% of the time and the rest should be "Truck". At other times, I may need to fill 50% of Column B cells with "Car" and the rest with "Bike".

Can you pls help me with a VBA code for this?

Thanks!!
 
Upvote 0
Excel_Girl,

Welcome to the MrExcel forum.

It is always easier to help and test possible solutions if we could work with your actual file.

Perhaps you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com.

Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here.

Include a detailed explanation of what you would like to do referring to specific cells and worksheets.

If the workbook contains confidential information, you could replace it with generic data.


Sure, I will do that. Thanks
 
Upvote 0
what makes

djajdjajd@gmail.com
Car
a;ldkjfas;lkdfk@gmail.comTruck

<tbody>
</tbody>

you have no logic there at all as far as i can see
 
Upvote 0
Okay here is the logic. Every week, I need to send marketing emails to a few email ids (usually 1000-2000). Now, I need to send "Car" related email to half of the email ids and "Truck" to the other half. I need to first fill in Column B as "Car" or "Truck" for our record, so that we dont repeat sending the same product email twice.
 
Upvote 0
Okay here is the logic. Every week, I need to send marketing emails to a few email ids (usually 1000-2000). Now, I need to send "Car" related email to half of the email ids and "Truck" to the other half. I need to first fill in Column B as "Car" or "Truck" for our record, so that we dont repeat sending the same product email twice.
 
Upvote 0
OK, so maybe you need a RANDOM Generator to do that. It wasn't evident that it is a form of cold calling. Don't do it in the UK
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,539
Members
449,088
Latest member
RandomExceller01

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