Changed your function to this.
Function FindLastDateCell() As String
Dim c As Integer, lttr As String
Range("B2").Select
Do Until IsDate(ActiveCell) = False
ActiveCell.Offset(0, 1).Select
c = c + 1
Loop
c = c + 1
lttr = Split(Columns(c).Address(1, 0), ":", -1, 1)(0)
If c > 10 Then
firstcol = Split(Columns(c - 10).Address(1, 0), ":", -1, 1)(0)
Else
fisrtcol = "B"
End If
FindLastDateCell = firstcol & ";" & lttr
End Function
In case lastcolumis AD it gives you
FindLastDateCell = "T;AD"
In your Port code I changed
to this
firstlttr = Split(FindLastDateCell, ";")(0)
lttr = Split(FindLastDateCell, ";")(1)
Which gives you firstlttr = "T" and lttr = "AD"
Now you can play around with both variables to suit your need.
Bookmarks