Copy and Paste Multiple Times

djb14128

New Member
Joined
Nov 14, 2019
Messages
27
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
32,030
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
27
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
27
Why does it not work for longer/more complex excel spreadsheet? Many thanks.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,030
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,081,657
Messages
5,360,291
Members
400,580
Latest member
Drexl88

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top