I’ll try and shorten the task to its smallest part as each source row has 52 columns and I have 1000’s of row to reformat.
I need to copy data from
sheet1 Row1 columns ABCD to sheet2 row 1 and repeat like this
Row1 columns ABCE to sheet2 row 2
Row1 columns ABCG to sheet2 row 3
then go to next row (2) in sheet 1 and repeat
Row2 columns ABCD to sheet2 row 4 and repeat like this
Row2 columns ABCE to sheet2 row 5
Row2 columns ABCG to sheet2 row 6
I've started with the code below then really got stuck with how to procede. Any help would be greatly appreciated.
Sub InvoiceCosts()
Dim MyLastRow As Long, x As Long, j As Long
Dim BGTree As Long, BGName As String, RG As String, DateFrom As Date, DateTo As Date
Dim PeriodDate As Date, Period As Date, Balance As Integer
Dim sWBU As Worksheet
Dim sWBUT As Worksheet
j = 12
Set sWBU = Worksheets("Wish Budg To Be uploaded") ' Name of worksheets for data source
Set sWBUT = Worksheets("Test") ' Name of worksheets for data destination
MyLastRow = sWBU.Cells(Application.Rows.Count, 2).End(xlUp).Row 'Find Final Row in dataset
BGTree = sWBU.Cells(j, 4).Value
BGName = sWBU.Cells(j, 12).Value
DateFrom = sWBU.Cells(j, 6).Value
DateTo = sWBU.Cells(j, 7).Value
PeriodDate = sWBU.Cells(j, 5).Value
Period = sWBU.Cells(j, 8).Value
Balance = sWBU.Cells(j, 16).Value
'MsgBox BGTree
x = 2 'To 52 'MyLastRow
sWBUT.Cells(x, 1).Value = BGTree
sWBUT.Cells(x, 2).Value = BGName
sWBUT.Cells(x, 3).Value = BGTree
sWBUT.Cells(x, 4).Value = BGTree
sWBUT.Cells(x, 5).Value = BGTree
sWBUT.Cells(x, 6).Value = BGTree
sWBUT.Cells(x, 7).Value = BGTree
sWBUT.Cells(x, 8).Value = BGName
sWBUT.Cells(x, 9).Value = "Range"
sWBUT.Cells(x, 11).Value = DateFrom
sWBUT.Cells(x, 12).Value = DateTo
sWBUT.Cells(x, 13).Value = PeriodDate
sWBUT.Cells(x, 14).Value = Period
sWBUT.Cells(x, 15).Value = Balance
sWBUT.Cells(x, 17).Value = Balance
'Next x
Bookmarks