Hello Riz,
I have added a button to "Sheet2" to run the macro below. This will copy the data, add the needed rows, and right align the two newly added rows for each entry.
Sub AddRowsAndFormat()
Dim Cell As Range
Dim Data As Variant
Dim DstRng As Range
Dim r As Long
Dim RngEnd As Range
Dim SrcRng As Range
Set SrcRng = Worksheets("Sheet1").Range("A1")
Set DstRng = Worksheets("Sheet2").Range("A1")
Set RngEnd = SrcRng.Parent.Cells(Rows.Count, SrcRng.Column).End(xlUp)
If RngEnd.Row < SrcRng.Row Then Exit Sub
Set SrcRng = SrcRng.Parent.Range(SrcRng, RngEnd).Resize(ColumnSize:=2)
ReDim Data(1 To SrcRng.Rows.Count * 3, 1 To 2)
Application.ScreenUpdating = False
For Each Cell In SrcRng.Columns(1).Cells
r = r + 1
Data(r, 1) = Cell
Data(r, 2) = Cell.Offset(0, 1)
Data(r + 1, 1) = ""
Data(r + 1, 2) = "Invoices Generated"
Data(r + 2, 1) = ""
Data(r + 2, 2) = "Invoices Paid"
r = r + 2
Next Cell
DstRng.Parent.Columns(1).EntireColumn.Clear
DstRng.Parent.Columns(2).EntireColumn.Clear
Set DstRng = DstRng.Resize(UBound(Data, 1), 2)
DstRng.Value = Data
For r = 1 To DstRng.Rows.Count Step 3
DstRng.Item(r + 1, 2).Resize(2, 1).HorizontalAlignment = xlHAlignRight
Next r
Application.ScreenUpdating = True
End Sub
Bookmarks