Run-time error 424
Får en 424 error i den kode her, er der en der kan se fejlen ?Sub Gennemløb()
Dim wkbAktuel As Workbook
Dim c As Range
Dim sidsteR As Long
Dim SaelgerKol As Integer
Set wkbAktuel = ActiveWorkbook
sidsteR = wbkAktuel.Worksheets(1).Range("A1").Offset(wkbAktuel.Worksheets(1).Rows.Count - 1, 0).End(x1Up).Row
SaelgerKol = kolonneOffset(Range(wbkAktuel.Worksheets(1).Range("H1"), wbkAktuel.Worksheets(1).Range("H2").End(xlToRight)), "Navn")
For Each c In Range(wbkAktuel.Worksheets(1).Range("H2"), wkbAktuel.Worksheets(1).Offset(sidsteR - 1, 0)).Cells
Next
End Sub
Function kolonneOffset(omraade As Range, tekst As String) As Integer
Dim CC As Variant
Dim kol As Integer
kol = -1
For Each CC In omraade.Cells
If CC.Value = tekst Then
kol = CC.Column
End If
Next
kolonneOffset = kol - 1
End Function