I managed to make the Macro work, but row for row. And its far to slow. Based on the first position which is 20 rows, it would take about 6 hours to do one calculation of about 3000 rows.
Does anyone have ideas to make the macro significantly faster??
Sub C_COPY_BASISKALK()
'
' Een nieuwe kalkulatie maken op basis van een oude kalkulatie
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
' Application.Calculation = xlCalculationAutomatic
' Application.ScreenUpdating = True
' Basiskalk kopieren en herbenoemen naar Copykalk
'' Sheets("Basiskalk.").Copy before:=Sheets("Basiskalk.")
'' Sheets("Basiskalk. (2)").Name = "Copykalk1"
' Basiskalk kopieren en herbenoemen naar Copykalk2 tbv maken Macro, wordt later gewoon basiskalk
'' Sheets("Basiskalk.").Copy before:=Sheets("Basiskalk.")
'' Sheets("Basiskalk. (2)").Name = "Copykalk2"
Dim VolgNummer As Integer
Dim RijNummer As Integer
Dim VolgNummmerOud As Integer
Sheets("Copykalk").Select
ActiveSheet.Calculate
RijNummer = 6
VolgNummer = Cells(RijNummer, 1).Value
VolgNummerOud = 100
Sheets("Copykalk").Select
[A1] = VolgNummer
While VolgNummerOud < 999
Application.Run "ZC_Copy_Pos"
Sheets("Copykalk").Select
RijNummer = RijNummer + 1
VolgNummer = Cells(RijNummer, 1).Value
[A1] = VolgNummer
ActiveSheet.Calculate
VolgNummerOud = [B1].Value
Wend
Sheets("Copykalk2").Select
[A1].Select
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
MsgBox "Fertig!"
End Sub
Sub ZC_Copy_Pos()
Dim VolgNr As Integer
Dim Pos As Integer
Dim First As Integer
Dim Last As Integer
Dim RowNew As Integer
Dim RowOld As Integer
Sheets("Copykalk").Select
VolgNr = [A1]
Sheets("Copykalk").Select
Pos = [C1]
Sheets("Copykalk").Select
First = [F1]
Last = [G1]
RowOld = First
RowNew = Pos
While RowOld < Last + 1
'Copykalk2.[RowNew].Formula = Copykalk1.[RowOld].Formula
Sheets("Copykalk1").Select
Rows(RowOld).Copy
Sheets("Copykalk2").Select
Rows(RowNew).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
RowOld = RowOld + 1
RowNew = RowNew + 1
Wend
'Selecting the cell in row 8 and column 1
Cells(Pos, 2).Value = VolgNr
End Sub
Bookmarks