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.
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
42,956
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
42,956
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,872
Messages
5,489,427
Members
407,687
Latest member
NeoSez

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top