Run macro using drop down list

tezza

Active Member
Joined
Sep 10, 2006
Messages
382
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
  2. Web
Hi All

I'm looking to run and repeat a macro the uses data from a drop down list until the list is completed, here's the details.

On Sheet 2 B1 a drop down list grabs data from AS1 down, here's a breakdown of what I'm trying to achieve:

Step 1: select the first item on the drop down list
Step 2: run a macro call 'grab'
Step 3: run a macro called 'send'
Step 4: move onto the next item in the list, rinse and repeat until the full drop down list has been done.

All this is actually doing is selecting a site, filtering the data from sheet 1 and putting it into sheet 2 then sending that data to a new workbook ready to be emailed off.

Hope you can help
Regards
Tezza
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Code:
Dim rng As Range, cel As Range
Set rng = Evaluate([B1].Validation.Formula1)
For Each cel In rng
    [B1]=cel.Value
    Call grab
    Call send
Next
 
Last edited:
Upvote 0
Hi

Thank you for this. What I'm now finding is that after sending the data to a new workbook the code tries to then run from the new workbook, any idea how you get around that.

When I run my send macro it automatically puts me into the new workbook also.

Regards
 
Upvote 0
Unable to comment without knowing what your macros do.

Try :
Code:
Dim rng As Range, cel As Range
Set rng = Evaluate(Sheets("Sheet1").[B1].Validation.Formula1)
For Each cel In rng
    Sheets("Sheet1").[B1]=cel.Value
    Call grab
    Call send
Next
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

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