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,187
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,187
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,943
Messages
5,362,268
Members
400,674
Latest member
Thumper007

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top