Calling experienced excel users

This macro should do exactly what you want Chewy.

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

Chewy, I think Rockos macro should do exactly what you want.

Don’t confuse the lad FFS!

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.

I just realised how much money I could make from reading through this thread.

Still don’t get it.

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

So they’re not totalled then? You just have a number and need to work out which lodgements add up to match that number?

Now that’s complicated stuff.

Is it a set number of amounts that make up the total or could it be a varied number of amounts?

You would need a clever macro to do that or if you have the Solver add-in installed that should help.

Jaysus that’s a mad fucking question so many things could go wrong in it.

I have a load of random numbers
And I have another random number.
Now I want to find which of the random numbers could make up this random number.

Chewey are there any jobs going there? I could go in there, write a quick macro and look like a God.

Runty knows the score !

Macro shmacro. You could go in there turn on a computer and be a God.

Yes. Totalling the rows is irrelevant really, lets just say they always add up to more than the lodgement.

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?

Forget excel, you need:

http://images.mirror.co.uk/upl/m4/nov2008/0/2/C18572DA-044B-5816-95D2E30762E907B9.jpg

Call the bank and ask.

I would just pick a few rows at random and modify their contents to make up to total you require.