Hoping to seek some assistance on the following.
I have a range that i want to copy however i want to format the data before pasting (spreadsheet attached)
Firstly i want to copy a field from Column D in the 1st and every 6th row and paste it to Column E, and loop it to the end of the series (illustrated with 'blue' arrows in the sheet).
Secondly i want to skip the 1st and every 6th row, when copying the range and paste it into the destination spreadsheet (the row i want to skip has a 'red' line through it)
Please find my code below.
Sub Update ()
Dim rngDestination As Range, rngSource As Range
Set rngDestination = ThisWorkbook.Worksheets("Data").Range("B" & Rows.Count).End(xlUp).Offset(1)
Workbooks.Open Filename:= _
"G:\Report\Report Sept15.xlsx"
fname = ActiveWorkbook.Name
With Workbooks(fname).Worksheets("Extract")
Set rngSource = .Range("D11", .Range("D" & Rows.Count).End(xlUp).Offset(-1))
End With
rngDestination.Resize(rngSource.Rows.Count, 1).Value = rngSource.Value
rngDestination.Offset(, -1).Resize(rngSource.Rows.Count).Value = Application.Max(rngDestination.Parent.Range("A:A")) + 1
Workbooks("Report Sept15.xlsx").Activate
ActiveWindow.Close
End Sub
Any assistance would be greatly appreciated!
Bookmarks