Problem mit Range
08.03.2018 11:07:53
Carsten
ich habe ein Problem und zwar klappt ein Range befehl nicht in einem Makro.
Allerdings wenn ich Range ("B3:B31") mache klappts.
Das Klappt:
Sub Testen()
spalte = (Sheets("Urlaubsplan 2018").Cells(1, 2).Value - 2016)
Range(Cells(2, spalte), Cells(31, spalte)).Select
End Sub
Das hier klappt nicht:Sub Urlaub_eintragen()
Dim lngZeile As Long
Dim lngSpalte As Long
Sheets("Urlaubsplan 2018").Activate
spalte = (Sheets("Urlaubsplan 2018").Cells(1, 2).Value - 2016)
For lngZeile = 3 To 19 Step 4
For lngSpalte = 2 To Cells(lngZeile, Columns.Count).End(xlToLeft).Column
If Not IsError(Application.Match(Cells(lngZeile, lngSpalte), Worksheets("Urlaubstage"). _
Range(Cells(2, spalte), Cells(31, spalte)), 0)) _
Then Cells(lngZeile + 2, lngSpalte) = "U"
Next lngSpalte
Next lngZeile
End Sub
Woran kann das liegen?:(