Repeating Macro

MIOMY

New Member
Joined
Mar 20, 2018
Messages
1
Hello,

I cannot program. I tried to make a macro and succeeded.

But I would want to repeat the macro until the end of numbers in the table.

Can you help me?

Here is the macro:



Sub Tulostuskollilappu()
'
' Tulostuskollilappu Makro
'


'

Range("A9").Select
ActiveCell.FormulaR1C1 = "=Taul1!R[-7]C"
Range("A10").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _
IgnorePrintAreas:=False
Range("A9").Select
ActiveCell.FormulaR1C1 = "=Taul1!R[-6]C"
Range("A10").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _
IgnorePrintAreas:=False





End Sub
 

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.
like this?

Rich (BB code):
for i = 9 to 6 step -1

Range("A9").Select
ActiveCell.FormulaR1C1 = "=Taul1!R[-" & i & "]C"
Range("A10").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, IgnorePrintAreas:=False

next
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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