Hello!
I have copied this macro from another forum and managed to adapt it to my purpose. Now when I moved it to another joined server, it doens't work anymore. I get an error message when trying to copy the sheet ("Kontrakt"). As I am a total beginner in VBA, I struggle to understand why, even though I believe that's because something wrong at the beginning of the macro.
Could anyone help? I believe this is quite simple, but as a beginner it's impossible for me t find out a solution.
Regards!
Emmanuel
Sub Makro1()
Dim arbeidsark As Worksheet, i&, nomf$
Set arbeidsark = Worksheets("Liste over sensorer")
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
nomf = Range("A" & i)
vekting = Range("C" & i)
fagansvarlig = Range("B" & i)
dato = Range("D" & i)
Worksheets("Kontrakt").Copy
Range("I27") = nomf & " " & eksamensform
Range("L30") = vekting
Range("O27") = fagansvarlig
With ActiveWorkbook
.SaveAs ThisWorkbook.Path & "\" & "Sensorkontrakt" & " " & nomf & " " & eksamensform & ".xlsx"
.Close
End With
Next i
End Sub
Bookmarks