enfantter
11-08-2007, 02:54 AM
Hey all,
I have a sheet which keeps on giving me problems...
I have the following code which generates some lines which assignments. There is a reference to a cell (cell(2, 9)) which shows this year. That means that i from the userform can create the assignments that have to be done this year (now 2007, actually this is 12 replications of the same assignment). What I would like to do is that if an assignment is create (fx) now i would like to enter values for the coming year, that is the two remaining months, but then jan, feb. march, etc should be 2008.
Does anybody se any simple way to come around this???
ElseIf nyfrek = 12 Then
'M?nedlige opgaver
If nyfrek = 12 Then
With Worksheets("Indtastning af ny opgave")
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Cells(lastrow + 1, "A").Value = nyTxt.Text
.Cells(lastrow + 1, "B").Value = nycmbans.Text
.Cells(lastrow + 1, "C").Value = nycmbmod.Text
.Cells(lastrow + 1, "D").Value = nycmbkar.Text
.Cells(lastrow + 1, "E").Value = nydagnr.Text
End With
With Worksheets("Struktur")
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Cells(lastrow + 1, "A").Value = nyTxt.Text
.Cells(lastrow + 1, "B").Value = nycmbans.Text
.Cells(lastrow + 1, "C").Value = nycmbmod.Text
.Cells(lastrow + 1, "D").Value = nycmbkar.Text
.Cells(lastrow + 1, "E").Value = Nyantalpers.Text
.Cells(lastrow + 1, "F").Value = nyvar.Text
.Cells(lastrow + 1, "G").Value = nyfrek.Text
.Cells(lastrow + 1, "H").Value = 1
.Cells(lastrow + 1, "I").Value = "jan"
.Cells(lastrow + 1, "J").Value = nydagnr.Text
.Cells(lastrow + 1, "K").Value = Workday(DateSerial(Cells(2, 9).Value, 0 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 1, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 0 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 2, "A").Value = nyTxt.Text
.Cells(lastrow + 2, "B").Value = nycmbans.Text
.Cells(lastrow + 2, "C").Value = nycmbmod.Text
.Cells(lastrow + 2, "D").Value = nycmbkar.Text
.Cells(lastrow + 2, "E").Value = Nyantalpers.Text
.Cells(lastrow + 2, "F").Value = nyvar.Text
.Cells(lastrow + 2, "G").Value = nyfrek.Text
.Cells(lastrow + 2, "H").Value = 2
.Cells(lastrow + 2, "I").Value = "feb"
.Cells(lastrow + 2, "J").Value = nydagnr.Text
.Cells(lastrow + 2, "K").Value = Workday(DateSerial(Cells(2, 9), 1 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 2, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 1 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 3, "A").Value = nyTxt.Text
.Cells(lastrow + 3, "B").Value = nycmbans.Text
.Cells(lastrow + 3, "C").Value = nycmbmod.Text
.Cells(lastrow + 3, "D").Value = nycmbkar.Text
.Cells(lastrow + 3, "E").Value = Nyantalpers.Text
.Cells(lastrow + 3, "F").Value = nyvar.Text
.Cells(lastrow + 3, "G").Value = nyfrek.Text
.Cells(lastrow + 3, "H").Value = 3
.Cells(lastrow + 3, "I").Value = "mar"
.Cells(lastrow + 3, "J").Value = nydagnr.Text
.Cells(lastrow + 3, "K").Value = Workday(DateSerial(Cells(2, 9), 2 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 3, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 2 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 4, "A").Value = nyTxt.Text
.Cells(lastrow + 4, "B").Value = nycmbans.Text
.Cells(lastrow + 4, "C").Value = nycmbmod.Text
.Cells(lastrow + 4, "D").Value = nycmbkar.Text
.Cells(lastrow + 4, "E").Value = Nyantalpers.Text
.Cells(lastrow + 4, "F").Value = nyvar.Text
.Cells(lastrow + 4, "G").Value = nyfrek.Text
.Cells(lastrow + 4, "H").Value = 4
.Cells(lastrow + 4, "I").Value = "apr"
.Cells(lastrow + 4, "J").Value = nydagnr.Text
.Cells(lastrow + 4, "K").Value = Workday(DateSerial(Cells(2, 9), 3 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 4, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 3 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 5, "A").Value = nyTxt.Text
.Cells(lastrow + 5, "B").Value = nycmbans.Text
.Cells(lastrow + 5, "C").Value = nycmbmod.Text
.Cells(lastrow + 5, "D").Value = nycmbkar.Text
.Cells(lastrow + 5, "E").Value = Nyantalpers.Text
.Cells(lastrow + 5, "F").Value = nyvar.Text
.Cells(lastrow + 5, "G").Value = nyfrek.Text
.Cells(lastrow + 5, "H").Value = 5
.Cells(lastrow + 5, "I").Value = "maj"
.Cells(lastrow + 5, "J").Value = nydagnr.Text
.Cells(lastrow + 5, "K").Value = Workday(DateSerial(Cells(2, 9), 4 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 5, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 4 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 6, "A").Value = nyTxt.Text
.Cells(lastrow + 6, "B").Value = nycmbans.Text
.Cells(lastrow + 6, "C").Value = nycmbmod.Text
.Cells(lastrow + 6, "D").Value = nycmbkar.Text
.Cells(lastrow + 6, "E").Value = Nyantalpers.Text
.Cells(lastrow + 6, "F").Value = nyvar.Text
.Cells(lastrow + 6, "G").Value = nyfrek.Text
.Cells(lastrow + 6, "H").Value = 6
.Cells(lastrow + 6, "I").Value = "jun"
.Cells(lastrow + 6, "J").Value = nydagnr.Text
.Cells(lastrow + 6, "K").Value = Workday(DateSerial(Cells(2, 9), 5 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 6, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 5 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 7, "A").Value = nyTxt.Text
.Cells(lastrow + 7, "B").Value = nycmbans.Text
.Cells(lastrow + 7, "C").Value = nycmbmod.Text
.Cells(lastrow + 7, "D").Value = nycmbkar.Text
.Cells(lastrow + 7, "E").Value = Nyantalpers.Text
.Cells(lastrow + 7, "F").Value = nyvar.Text
.Cells(lastrow + 7, "G").Value = nyfrek.Text
.Cells(lastrow + 7, "H").Value = 7
.Cells(lastrow + 7, "I").Value = "jul"
.Cells(lastrow + 7, "J").Value = nydagnr.Text
.Cells(lastrow + 7, "K").Value = Workday(DateSerial(Cells(2, 9), 6 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 7, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 6 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 8, "A").Value = nyTxt.Text
.Cells(lastrow + 8, "B").Value = nycmbans.Text
.Cells(lastrow + 8, "C").Value = nycmbmod.Text
.Cells(lastrow + 8, "D").Value = nycmbkar.Text
.Cells(lastrow + 8, "E").Value = Nyantalpers.Text
.Cells(lastrow + 8, "F").Value = nyvar.Text
.Cells(lastrow + 8, "G").Value = nyfrek.Text
.Cells(lastrow + 8, "H").Value = 8
.Cells(lastrow + 8, "I").Value = "aug"
.Cells(lastrow + 8, "J").Value = nydagnr.Text
.Cells(lastrow + 8, "K").Value = Workday(DateSerial(Cells(2, 9), 7 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 8, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 7 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 9, "A").Value = nyTxt.Text
.Cells(lastrow + 9, "B").Value = nycmbans.Text
.Cells(lastrow + 9, "C").Value = nycmbmod.Text
.Cells(lastrow + 9, "D").Value = nycmbkar.Text
.Cells(lastrow + 9, "E").Value = Nyantalpers.Text
.Cells(lastrow + 9, "F").Value = nyvar.Text
.Cells(lastrow + 9, "G").Value = nyfrek.Text
.Cells(lastrow + 9, "H").Value = 9
.Cells(lastrow + 9, "I").Value = "sep"
.Cells(lastrow + 9, "J").Value = nydagnr.Text
.Cells(lastrow + 9, "K").Value = Workday(DateSerial(Cells(2, 9), 8 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 9, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 8 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 10, "A").Value = nyTxt.Text
.Cells(lastrow + 10, "B").Value = nycmbans.Text
.Cells(lastrow + 10, "C").Value = nycmbmod.Text
.Cells(lastrow + 10, "D").Value = nycmbkar.Text
.Cells(lastrow + 10, "E").Value = Nyantalpers.Text
.Cells(lastrow + 10, "F").Value = nyvar.Text
.Cells(lastrow + 10, "G").Value = nyfrek.Text
.Cells(lastrow + 10, "H").Value = 10
.Cells(lastrow + 10, "I").Value = "okt"
.Cells(lastrow + 10, "J").Value = nydagnr.Text
.Cells(lastrow + 10, "K").Value = Workday(DateSerial(Cells(2, 9), 9 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 10, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 9 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 11, "A").Value = nyTxt.Text
.Cells(lastrow + 11, "B").Value = nycmbans.Text
.Cells(lastrow + 11, "C").Value = nycmbmod.Text
.Cells(lastrow + 11, "D").Value = nycmbkar.Text
.Cells(lastrow + 11, "E").Value = Nyantalpers.Text
.Cells(lastrow + 11, "F").Value = nyvar.Text
.Cells(lastrow + 11, "G").Value = nyfrek.Text
.Cells(lastrow + 11, "H").Value = 11
.Cells(lastrow + 11, "I").Value = "nov"
.Cells(lastrow + 11, "J").Value = nydagnr.Text
.Cells(lastrow + 11, "K").Value = Workday(DateSerial(Cells(2, 9), 10 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 11, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 10 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 12, "A").Value = nyTxt.Text
.Cells(lastrow + 12, "B").Value = nycmbans.Text
.Cells(lastrow + 12, "C").Value = nycmbmod.Text
.Cells(lastrow + 12, "D").Value = nycmbkar.Text
.Cells(lastrow + 12, "E").Value = Nyantalpers.Text
.Cells(lastrow + 12, "F").Value = nyvar.Text
.Cells(lastrow + 12, "G").Value = nyfrek.Text
.Cells(lastrow + 12, "H").Value = 12
.Cells(lastrow + 12, "I").Value = "dec"
.Cells(lastrow + 12, "J").Value = nydagnr.Text
.Cells(lastrow + 12, "K").Value = Workday(DateSerial(Cells(2, 9), 11 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 12, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 11 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
End With
End If
I have a sheet which keeps on giving me problems...
I have the following code which generates some lines which assignments. There is a reference to a cell (cell(2, 9)) which shows this year. That means that i from the userform can create the assignments that have to be done this year (now 2007, actually this is 12 replications of the same assignment). What I would like to do is that if an assignment is create (fx) now i would like to enter values for the coming year, that is the two remaining months, but then jan, feb. march, etc should be 2008.
Does anybody se any simple way to come around this???
ElseIf nyfrek = 12 Then
'M?nedlige opgaver
If nyfrek = 12 Then
With Worksheets("Indtastning af ny opgave")
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Cells(lastrow + 1, "A").Value = nyTxt.Text
.Cells(lastrow + 1, "B").Value = nycmbans.Text
.Cells(lastrow + 1, "C").Value = nycmbmod.Text
.Cells(lastrow + 1, "D").Value = nycmbkar.Text
.Cells(lastrow + 1, "E").Value = nydagnr.Text
End With
With Worksheets("Struktur")
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Cells(lastrow + 1, "A").Value = nyTxt.Text
.Cells(lastrow + 1, "B").Value = nycmbans.Text
.Cells(lastrow + 1, "C").Value = nycmbmod.Text
.Cells(lastrow + 1, "D").Value = nycmbkar.Text
.Cells(lastrow + 1, "E").Value = Nyantalpers.Text
.Cells(lastrow + 1, "F").Value = nyvar.Text
.Cells(lastrow + 1, "G").Value = nyfrek.Text
.Cells(lastrow + 1, "H").Value = 1
.Cells(lastrow + 1, "I").Value = "jan"
.Cells(lastrow + 1, "J").Value = nydagnr.Text
.Cells(lastrow + 1, "K").Value = Workday(DateSerial(Cells(2, 9).Value, 0 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 1, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 0 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 2, "A").Value = nyTxt.Text
.Cells(lastrow + 2, "B").Value = nycmbans.Text
.Cells(lastrow + 2, "C").Value = nycmbmod.Text
.Cells(lastrow + 2, "D").Value = nycmbkar.Text
.Cells(lastrow + 2, "E").Value = Nyantalpers.Text
.Cells(lastrow + 2, "F").Value = nyvar.Text
.Cells(lastrow + 2, "G").Value = nyfrek.Text
.Cells(lastrow + 2, "H").Value = 2
.Cells(lastrow + 2, "I").Value = "feb"
.Cells(lastrow + 2, "J").Value = nydagnr.Text
.Cells(lastrow + 2, "K").Value = Workday(DateSerial(Cells(2, 9), 1 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 2, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 1 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 3, "A").Value = nyTxt.Text
.Cells(lastrow + 3, "B").Value = nycmbans.Text
.Cells(lastrow + 3, "C").Value = nycmbmod.Text
.Cells(lastrow + 3, "D").Value = nycmbkar.Text
.Cells(lastrow + 3, "E").Value = Nyantalpers.Text
.Cells(lastrow + 3, "F").Value = nyvar.Text
.Cells(lastrow + 3, "G").Value = nyfrek.Text
.Cells(lastrow + 3, "H").Value = 3
.Cells(lastrow + 3, "I").Value = "mar"
.Cells(lastrow + 3, "J").Value = nydagnr.Text
.Cells(lastrow + 3, "K").Value = Workday(DateSerial(Cells(2, 9), 2 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 3, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 2 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 4, "A").Value = nyTxt.Text
.Cells(lastrow + 4, "B").Value = nycmbans.Text
.Cells(lastrow + 4, "C").Value = nycmbmod.Text
.Cells(lastrow + 4, "D").Value = nycmbkar.Text
.Cells(lastrow + 4, "E").Value = Nyantalpers.Text
.Cells(lastrow + 4, "F").Value = nyvar.Text
.Cells(lastrow + 4, "G").Value = nyfrek.Text
.Cells(lastrow + 4, "H").Value = 4
.Cells(lastrow + 4, "I").Value = "apr"
.Cells(lastrow + 4, "J").Value = nydagnr.Text
.Cells(lastrow + 4, "K").Value = Workday(DateSerial(Cells(2, 9), 3 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 4, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 3 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 5, "A").Value = nyTxt.Text
.Cells(lastrow + 5, "B").Value = nycmbans.Text
.Cells(lastrow + 5, "C").Value = nycmbmod.Text
.Cells(lastrow + 5, "D").Value = nycmbkar.Text
.Cells(lastrow + 5, "E").Value = Nyantalpers.Text
.Cells(lastrow + 5, "F").Value = nyvar.Text
.Cells(lastrow + 5, "G").Value = nyfrek.Text
.Cells(lastrow + 5, "H").Value = 5
.Cells(lastrow + 5, "I").Value = "maj"
.Cells(lastrow + 5, "J").Value = nydagnr.Text
.Cells(lastrow + 5, "K").Value = Workday(DateSerial(Cells(2, 9), 4 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 5, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 4 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 6, "A").Value = nyTxt.Text
.Cells(lastrow + 6, "B").Value = nycmbans.Text
.Cells(lastrow + 6, "C").Value = nycmbmod.Text
.Cells(lastrow + 6, "D").Value = nycmbkar.Text
.Cells(lastrow + 6, "E").Value = Nyantalpers.Text
.Cells(lastrow + 6, "F").Value = nyvar.Text
.Cells(lastrow + 6, "G").Value = nyfrek.Text
.Cells(lastrow + 6, "H").Value = 6
.Cells(lastrow + 6, "I").Value = "jun"
.Cells(lastrow + 6, "J").Value = nydagnr.Text
.Cells(lastrow + 6, "K").Value = Workday(DateSerial(Cells(2, 9), 5 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 6, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 5 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 7, "A").Value = nyTxt.Text
.Cells(lastrow + 7, "B").Value = nycmbans.Text
.Cells(lastrow + 7, "C").Value = nycmbmod.Text
.Cells(lastrow + 7, "D").Value = nycmbkar.Text
.Cells(lastrow + 7, "E").Value = Nyantalpers.Text
.Cells(lastrow + 7, "F").Value = nyvar.Text
.Cells(lastrow + 7, "G").Value = nyfrek.Text
.Cells(lastrow + 7, "H").Value = 7
.Cells(lastrow + 7, "I").Value = "jul"
.Cells(lastrow + 7, "J").Value = nydagnr.Text
.Cells(lastrow + 7, "K").Value = Workday(DateSerial(Cells(2, 9), 6 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 7, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 6 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 8, "A").Value = nyTxt.Text
.Cells(lastrow + 8, "B").Value = nycmbans.Text
.Cells(lastrow + 8, "C").Value = nycmbmod.Text
.Cells(lastrow + 8, "D").Value = nycmbkar.Text
.Cells(lastrow + 8, "E").Value = Nyantalpers.Text
.Cells(lastrow + 8, "F").Value = nyvar.Text
.Cells(lastrow + 8, "G").Value = nyfrek.Text
.Cells(lastrow + 8, "H").Value = 8
.Cells(lastrow + 8, "I").Value = "aug"
.Cells(lastrow + 8, "J").Value = nydagnr.Text
.Cells(lastrow + 8, "K").Value = Workday(DateSerial(Cells(2, 9), 7 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 8, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 7 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 9, "A").Value = nyTxt.Text
.Cells(lastrow + 9, "B").Value = nycmbans.Text
.Cells(lastrow + 9, "C").Value = nycmbmod.Text
.Cells(lastrow + 9, "D").Value = nycmbkar.Text
.Cells(lastrow + 9, "E").Value = Nyantalpers.Text
.Cells(lastrow + 9, "F").Value = nyvar.Text
.Cells(lastrow + 9, "G").Value = nyfrek.Text
.Cells(lastrow + 9, "H").Value = 9
.Cells(lastrow + 9, "I").Value = "sep"
.Cells(lastrow + 9, "J").Value = nydagnr.Text
.Cells(lastrow + 9, "K").Value = Workday(DateSerial(Cells(2, 9), 8 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 9, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 8 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 10, "A").Value = nyTxt.Text
.Cells(lastrow + 10, "B").Value = nycmbans.Text
.Cells(lastrow + 10, "C").Value = nycmbmod.Text
.Cells(lastrow + 10, "D").Value = nycmbkar.Text
.Cells(lastrow + 10, "E").Value = Nyantalpers.Text
.Cells(lastrow + 10, "F").Value = nyvar.Text
.Cells(lastrow + 10, "G").Value = nyfrek.Text
.Cells(lastrow + 10, "H").Value = 10
.Cells(lastrow + 10, "I").Value = "okt"
.Cells(lastrow + 10, "J").Value = nydagnr.Text
.Cells(lastrow + 10, "K").Value = Workday(DateSerial(Cells(2, 9), 9 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 10, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 9 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 11, "A").Value = nyTxt.Text
.Cells(lastrow + 11, "B").Value = nycmbans.Text
.Cells(lastrow + 11, "C").Value = nycmbmod.Text
.Cells(lastrow + 11, "D").Value = nycmbkar.Text
.Cells(lastrow + 11, "E").Value = Nyantalpers.Text
.Cells(lastrow + 11, "F").Value = nyvar.Text
.Cells(lastrow + 11, "G").Value = nyfrek.Text
.Cells(lastrow + 11, "H").Value = 11
.Cells(lastrow + 11, "I").Value = "nov"
.Cells(lastrow + 11, "J").Value = nydagnr.Text
.Cells(lastrow + 11, "K").Value = Workday(DateSerial(Cells(2, 9), 10 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 11, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 10 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
.Cells(lastrow + 12, "A").Value = nyTxt.Text
.Cells(lastrow + 12, "B").Value = nycmbans.Text
.Cells(lastrow + 12, "C").Value = nycmbmod.Text
.Cells(lastrow + 12, "D").Value = nycmbkar.Text
.Cells(lastrow + 12, "E").Value = Nyantalpers.Text
.Cells(lastrow + 12, "F").Value = nyvar.Text
.Cells(lastrow + 12, "G").Value = nyfrek.Text
.Cells(lastrow + 12, "H").Value = 12
.Cells(lastrow + 12, "I").Value = "dec"
.Cells(lastrow + 12, "J").Value = nydagnr.Text
.Cells(lastrow + 12, "K").Value = Workday(DateSerial(Cells(2, 9), 11 + val(nystart.Value), 0), val(nydagnr.Value))
.Cells(lastrow + 12, "L").Value = Workday(Workday(DateSerial(Cells(2, 9).Value, 11 + val(nystart.Value), 0), val(nydagnr.Value)), nyvar - 1)
End With
End If