Extend Macro to new range

ferr

New Member
Joined
Jun 9, 2022
Messages
24
Office Version
  1. 365
Platform
  1. Windows
Sheets("AR Trend").Select

Columns("C:C").Select

Range("C7").Activate

Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove

Columns("D:D").Select

Range("D7").Activate

Selection.Copy

Columns("C:C").Select

Range("C7").Activate

Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _

SkipBlanks:=False, Transpose:=False

Application.CutCopyMode = False

ActiveWindow.SmallScroll Down:=-42

Range("C3").Select

ActiveCell.FormulaR1C1 = "=+'Summary AR'!R79C5"

Range("C13").Select

ActiveCell.FormulaR1C1 = "=+R[-10]C"

Range("C4").Select

Sheets("Summary AR").Select

ActiveWindow.SmallScroll Down:=-24

Range("E65:E71").Select

Selection.Copy

Sheets("AR Trend").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False

Range("C14").Select

Sheets("Summary AR").Select

ActiveWindow.SmallScroll Down:=9

Range("E80:E86").Select

Application.CutCopyMode = False

Selection.Copy

Sheets("AR Trend").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False

Range("D21:D43").Select

Application.CutCopyMode = False

Selection.Copy

Range("C21").Select

Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _

SkipBlanks:=False, Transpose:=False

Range("C3:C20").Select

Range("C20").Activate

Application.CutCopyMode = False

Selection.Copy

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False

ActiveWindow.SmallScroll Down:=3

Sheets("Summary AR").Select

ActiveSheet.ChartObjects("Chart 5").Activate

ActiveChart.PlotArea.Select

ActiveWindow.SmallScroll Down:=-18

ActiveSheet.ChartObjects("Chart 4").Activate

ActiveChart.PlotArea.Select

Application.CutCopyMode = False

ActiveChart.SetSourceData Source:=Sheets("AR Trend").Range("B25:B32,C25:DS32" _

)

ActiveSheet.ChartObjects("Chart 5").Activate

ActiveChart.PlotArea.Select

ActiveChart.FullSeriesCollection(1).XValues = "='AR Trend'!$C$35:$DS$35"

ActiveChart.FullSeriesCollection(1).Values = "='AR Trend'!$C$36:$DS$36"

ActiveChart.FullSeriesCollection(2).Values = "='AR Trend'!$C$37:$DS$37"

ActiveChart.FullSeriesCollection(3).Values = "='AR Trend'!$C$38:$DS$38"

ActiveChart.FullSeriesCollection(4).Values = "='AR Trend'!$C$39:$DS$39"

ActiveChart.FullSeriesCollection(5).Values = "='AR Trend'!$C$40:$DS$40"

ActiveChart.FullSeriesCollection(6).Values = "='AR Trend'!$C$41:$DS$41"

ActiveChart.FullSeriesCollection(7).Values = "='AR Trend'!$C$43:$DS$43"

ActiveChart.FullSeriesCollection(7).XValues = "='AR Trend'!$C$35:$DS$35"

Range("AC29").Select

ActiveWindow.SmallScroll Down:=9

End Sub




looking to extend the macro above to cover the new range of cells added in AR Trend and Summary AR
SAO is the current Summary AR and 'to' is the current AR Trend.
Added 8 new rows for each grouping.. See Summary AR new and trend new
 

Attachments

  • SAO.PNG
    SAO.PNG
    8.1 KB · Views: 15
  • Summary AR new.PNG
    Summary AR new.PNG
    14.8 KB · Views: 13
  • to.PNG
    to.PNG
    18.2 KB · Views: 14
  • trend new.PNG
    trend new.PNG
    20.6 KB · Views: 12

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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