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?
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

vaskov17

Well-known Member
Joined
Apr 27, 2011
Messages
920
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
 

Watch MrExcel Video

Forum statistics

Threads
1,128,055
Messages
5,628,338
Members
416,311
Latest member
S991102

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
Top