Hi
Very Good day

I am tried creating macro in developer option and using Record macro.
It works for same set of rows. But, when the rows are varying, it is pasting value till the row where i create rows
For an example, when i record macro, the rows were C6893, in the new sheet rows are C5000, but the macro pasting values till C6893.

I request you to help me on this.
This is the macro recorded code on excel
Sheets("Sheet2").Select
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Sheets("Sheet1").Select
Range("C1").Select
ActiveCell.FormulaR1C1 = "Today"
Range("D1").Select
ActiveCell.FormulaR1C1 = "Ageing"
Range("C2").Select
ActiveCell.FormulaR1C1 = "=TODAY()"
Range("D2").Select
ActiveCell.FormulaR1C1 = "=NETWORKDAYS(RC[-2],RC[-1])"
Range("D2").Select
Selection.NumberFormat = "0"
Range("C2:D2").Select
Selection.Copy
Range("B2").Select
Selection.End(xlDown).Select
Range("C1274").Select
Range(Selection, Selection.End(xlUp)).Select
Range("C2:D1274").Select
Range("C1274").Activate
ActiveSheet.Paste
Sheets("Sheet2").Select
Range("C1273").Select
Selection.End(xlUp).Select
Range("C1:D2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet3").Select
Range("C14").Select
Selection.End(xlUp).Select
ActiveSheet.Paste
Range("C2:D2").Select
Application.CutCopyMode = False
Selection.Copy
Range("B2").Select
Selection.End(xlDown).Select
Range("C6892:C6893").Select
Range("C6893").Activate
Range(Selection, Selection.End(xlUp)).Select
Range("C2:D6893").Select
Range("C6893").Activate
ActiveSheet.Paste
Range("C6890").Select
ActiveWindow.SmallScroll Down:=-24
Selection.End(xlUp).Select
End Sub


Thanks