Copy and Paste Multiple Times

djb14128

New Member
Joined
Nov 14, 2019
Messages
6
I just want to know why I am the Visual Basic Applications (VBA) script isn't working as it should be. I am trying to copy and paste multiple tables, depending on the value I put into cell E1. I've used this code here:

Sub CopyMulti()
Range("A3:D19").Copy Range("E15").Resize(14 * Range("E1").Value)
End Sub

Many thanks.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,378
Office Version
365
Platform
Windows
Hi & welcome to MrExcel.
It should be
Code:
Range("A3:D19").Copy Range("E15").Resize([COLOR=#ff0000]17[/COLOR] * Range("E1").Value)
 

djb14128

New Member
Joined
Nov 14, 2019
Messages
6
ABCDEFGHIJKLMNO
15
2Button 1
3
4ApplesBananasOranges
52=B5+10=C5*B5
64=B6+20=C6*B6
76=B7+30=C7*B7
88=B8+40=C8*B8
910=B9+50=C9*B9
1012=B10+60=C10*B10
1114=B11+70=C11*B11
1216=B12+80=C12*B12
1318=B13+90=C13*B13
1420=B14+100=C14*B14
1522=B15+110=C15*B15
1624=B16+120=C16*B16ApplesBananasOranges
1721224
1842496
19636216
20848384
211060600
221272864
2314841176
2416961536
25181081944
26201202400
27221322904
28241443456
29
30

<tbody>
</tbody>

This is what the excel spreadsheet looks like.
 

djb14128

New Member
Joined
Nov 14, 2019
Messages
6
Why does it not work for longer/more complex excel spreadsheet? Many thanks.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,378
Office Version
365
Platform
Windows
In future please do not make the same post multiple times. Note that sometimes posts from new users require Moderator approval before you can see them on the public forums. When this happens, you should see a message to that effect when you try to post it. Please be patient and do not attempt to post the question again.

What does the 17 mean? Many thanks.
It is the number of rows that you are originally copying.

Why does it not work for longer/more complex excel spreadsheet? Many thanks.
It would help if you explain what you are trying to do.
 

Forum statistics

Threads
1,078,137
Messages
5,338,458
Members
399,234
Latest member
WaddoAU

Some videos you may like

This Week's Hot Topics

Top