Please find sample file attached
Regards
John
John_Budgets to be imported.xlsm
Please find sample file attached
Regards
John
John_Budgets to be imported.xlsm
Solved the problem but it runs a bit slow...
![]()
Dim MyLastRow As Integer, i As Integer Dim x As Long, y As Long, j As Long, k As Long Dim BGTree As Long Dim BGName As String, RG As String, DateFrom As String, DateTo As String Dim PeriodDate As String, Period As String, Balance As String, AccountCode As String Dim sWBU As Worksheet, sWBUT As Worksheet i = 16 'Which column in data sheet is the first Balance/AccountCode j = 2 'Which row in new sheet to start at k = 53 'Which row in new sheet to stop at Set sWBU = Worksheets("Wish Budg To Be uploaded") ' Name of worksheets for data source Set sWBUT = Worksheets("Upload Data") ' Name of worksheets for data destination MyLastRow = sWBU.Cells(Application.Rows.Count, 2).End(xlUp).Row 'Find Final Row in dataset For y = 12 To MyLastRow '(y) Equates to row 12 of the first row of the source data For x = j To k BGTree = sWBU.Cells(y, 4).Value BGName = sWBU.Cells(y, 12).Value DateFrom = sWBU.Cells(y, 6).Value DateTo = sWBU.Cells(y, 7).Value PeriodDate = sWBU.Cells(y, 5).Value Period = sWBU.Cells(y, 8).Value Balance = sWBU.Cells(y, i).Value AccountCode = sWBU.Cells(7, i).Value 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, 16).Value = AccountCode sWBUT.Cells(x, 17).Value = Balance i = i + 1 Next x j = j + 52 k = k + 52 i = 16 Next y
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks