I am trying to copy range from sample reference card into another sheet and insert this range as row on above existing ones, multiple times.
Right now I have code that is working for inserting this range once:
Sub Nova_karta_export()
Sheets("nova_karta").Select
Rows("3:42").Select
Selection.Copy
Sheets("Export").Select
Rows("3:3").Select
Selection.Insert Shift:=xlDown
End Sub
I was able to modify it to insert this range multiple times based on value in cell "V1" in export sheet. But running this version is quite heavy on computing.
Sub Nova_karta_export_X_krat()
Dim numberoftimestorun As Integer
Dim i As Integer
numberoftimestorun = Sheets("Export").Range("V1").Value
For i = 1 To numberoftimestorun
Sheets("nova_karta").Select
Rows("3:42").Select
Selection.Copy
Sheets("Export").Select
Rows("3:3").Select
Selection.Insert Shift:=xlDown
Next i
End Sub
If I insert range for example ten times is computes very slow. I need to add even 50+ ranges.
How can I speed up this process? Through variables? And how to insert number of repeats through message window? I want that user can write number of repeat into window after running macro and not to be dependent on cell "V1"
Thanks for help.