Hi,
I have a problem concerning datatypes for an if-loop, the failure message tells me "Datatypes incompatible" for this code-line:
If CLng(.Worksheets("Database").Cells("R" & last)) >= CW Then
Here is also the full context:
CW = CLng(InputBox("Please enter the current week (1-53)", Week))
With ActiveWorkbook
last = .Worksheets("Database").Cells(Rows.Count, 18).End(xlUp).Row
i = 0
For u = 7 To last
If CLng(.Worksheets("Database").Cells("R" & last)) >= CW Then
.Worksheets("Database").Rows("last").Copy Destination:=.Worksheets(1).Rows("3+i")
End If
Next u
End With
Thanks in advance for your help!
Bookmarks