Sub copyrows()
Dim rng As Range, cell As Range
Dim rw As Long
Dim numRows As Variant
With ActiveSheet
Set rng = .Range(.Cells(1, 1), .Cells(1, 1).End(xlDown))
End With
Worksheets.Add
rw = 1
numRows = InputBox("How many rows times do you want to repeat each row?")
If Not IsNumeric(numRows) Then Exit Sub
For Each cell In rng
cell.EntireRow.Copy Destination:= _
ActiveSheet.Cells(rw, 1).Resize(numRows)
rw = rw + numRows
Next
End Sub
This macro should do exactly what you want Chewy for the first question. No idea what youâre asking about the totals though.
Sub copyrows()
Dim rng As Range, cell As Range
Dim rw As Long
Dim numRows As Variant
With ActiveSheet
Set rng = .Range(.Cells(1, 1), .Cells(1, 1).End(xlDown))
End With
Worksheets.Add
rw = 1
numRows = InputBox(âHow many rows times do you want to repeat each row?â)
If Not IsNumeric(numRows) Then Exit Sub
For Each cell In rng
cell.EntireRow.Copy Destination:= _
ActiveSheet.Cells(rw, 1).Resize(numRows)
rw = rw + numRows
Next
End Sub
No- Lets just say I was given a bank lodgement amount of 8700. I have 1000 rows of sales totalling around 19k, I have to find the combination of rows/amounts that total the lodgement.
Could it not be a number of different combinations.
If the lodgment is 5
And Sales is 10 rows totalling 20
There could be a few 2s and 3s in there which may or may not be part of the lodgement.
That is true but the exact amount is 8713.56 and all the row amounts are to 2 places of decimals too. Highly unlikely that there will be more than 1 combination of numbers that make up the total
From what I understand SO you have a loads of payments that are then lodged to an account. You need to figure out which payments make up which lodgement? Is that it?