Как включить в моем коде аналогичные действия для исходящих строк, т. Е. Для консолидированного диапазона просмотра B8 извлеките из диапазона просмотра большого города "B31", среднего диапазона просмотра города "B31", диапазона просмотра малого города "B31".
Sub Button1_Click()
Dim rLaunch As Range, c As Long
'table showing monthly total launches of small, medium and large cities
Set rLaunch = Worksheets("Launch").Range("C2").CurrentRegion
'remove headings so we just have numbers
Set rLaunch = rLaunch.Offset(, 2).Resize(, rLaunch.Columns.Count - 2)
'loop through each column of table (months)
For c = 1 To rLaunch.Columns.Count
'Revenue
'multiply small number by small revenue and add to same for medium and large
For d = 1 To c
a = a + _
rLaunch(1, d) * Worksheets("Big City View").Range("B30").Offset(, (c + 1 - d)) + _
rLaunch(2, d) * Worksheets("Medium City View").Range("B30").Offset(, (c + 1 - d)) + _
rLaunch(3, d) * Worksheets("Small City View").Range("B30").Offset(, (c + 1 - d))
Next d
Worksheets("Consolidated View").Range("B7").Offset(, c).Value = a
Next c
End Sub