VBA Loop

Davebro

Board Regular
Joined
Feb 22, 2018
Messages
120
Office Version
  1. 2021
  2. 2016
Platform
  1. Windows
I am still learning VBA and do not know how to make a loop for the following. This copies a cell and pastes it.

Sub Time()
'
' Macro TIme
'

'
ActiveCell.Select
Selection.Copy
ActiveCell.Offset(0, -1).Range("A1:A11").Select
ActiveSheet.Paste
ActiveCell.Offset(11, 1).Range("A1").Select
Application.CutCopyMode = False
Selection.Copy
ActiveCell.Offset(0, -1).Range("A1:A11").Select
ActiveSheet.Paste
ActiveCell.Offset(11, 1).Range("A1").Select
End Sub
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi,
Could you describe in plain English what you want to achieve ...
 
Upvote 0
Hi, I want to copy the contents of cell B2 to A2 to A11
then go to B13 and copy contents to B13 to B22
and repeat down the column.
 
Upvote 0
Just to clarify ... you mean:
Copy B2 to A2:A11
Copy B13 to A13:A22
Copy B24 to A24:A33
till the very last cell in column B ...

Is that right ?
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top