icestorm
06-01-2015, 12:01 AM
Hi, I am relatively new to VBA and therefore I would like to ask you for a help with VBA macro.
a) Current state
Worksheet "Customers" contains all our customers IDs in range B4:B72
Workheet "Send to customer" contains formulas which calculate current stock for one customer(When you insert his ID in cell B6)
VBA macro "Send email" saves Worksheet "Send to customers" as PDF and send it via e-mail to customer with ID in Cell B6
The problem is, that every time you want to send email to a customer you have to manually insert his ID in cell B6 (data validation button) and run a macro "Send email", but once per month we send the current level of stock to all our customers, hence we need a loop macro to get rid of manually inserting IDs over and over again.
b) Desired state:
Loop Macro "send e-mail to all":
Logic:
1) Select "ID of customer 1" (cell B4) from worksheet "Customers", insert that ID in cell B6 in worksheet "Send to customer", wait 10s to calculate formulas, run macro "Send email"
2) Select "ID of customer 2" (cell B5) from worksheet "Customers", insert that ID in cell B6 in worksheet "Send to customer", wait 10s to calculate formulas, run macro "Send email"
...
69) Select "ID of customer 69" (cell B72) from worksheet "Customers", insert that ID in cell B6 in worksheet "Send to customer", wait 10s to calculate formulas, run macro "Send email"
Thanks in advance for your help. :)
a) Current state
Worksheet "Customers" contains all our customers IDs in range B4:B72
Workheet "Send to customer" contains formulas which calculate current stock for one customer(When you insert his ID in cell B6)
VBA macro "Send email" saves Worksheet "Send to customers" as PDF and send it via e-mail to customer with ID in Cell B6
The problem is, that every time you want to send email to a customer you have to manually insert his ID in cell B6 (data validation button) and run a macro "Send email", but once per month we send the current level of stock to all our customers, hence we need a loop macro to get rid of manually inserting IDs over and over again.
b) Desired state:
Loop Macro "send e-mail to all":
Logic:
1) Select "ID of customer 1" (cell B4) from worksheet "Customers", insert that ID in cell B6 in worksheet "Send to customer", wait 10s to calculate formulas, run macro "Send email"
2) Select "ID of customer 2" (cell B5) from worksheet "Customers", insert that ID in cell B6 in worksheet "Send to customer", wait 10s to calculate formulas, run macro "Send email"
...
69) Select "ID of customer 69" (cell B72) from worksheet "Customers", insert that ID in cell B6 in worksheet "Send to customer", wait 10s to calculate formulas, run macro "Send email"
Thanks in advance for your help. :)