worklist generator macro

oliverraaijmakers

New Member
Joined
Jun 25, 2012
Messages
3
Hello there,

I am trying to create a (macro) worklist-generator, which should create a list of activities for every deliverable that needs to be done.
The input "deliverable" is a list of numbers which can vary from 1 cell value, up to 50 (in the same column, below eachother). An empty cell indicates the end of the list.
The input "activities" is a list of teksts which can vary from 1 cell value, up to 25 (in the same column, below eachother). An empty cell indicates the end of the list.
The output should be a list of two columns (deliverable and activity), with all combinations of deliverables and activities listed below eachother.

Can anyone help me with a macro that can do this?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Deliverables in Column A
Activities in Column B
results will be in Columns D & E

Code:
Sub Macro()
    Dim rDeliverables As Range
    Dim rActivities As Range
    Dim c As Long
    Dim rDeliverable As Range
    Dim rActivity As Range
    
    Set rDeliverables = Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
    Set rActivities = Range("B1:B" & Range("B" & Rows.Count).End(xlUp).Row)
    
    Range("D:E").ClearContents
    c = 1
    For Each rDeliverable In rDeliverables
        For Each rActivity In rActivities
            Range("D" & c) = rDeliverable
            Range("E" & c) = rActivity
            c = c + 1
        Next
    Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,967
Messages
6,122,503
Members
449,090
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