Hello experts. I am looking for a little clarity. I'm curious why an error 13 is thrown when setting the range.
EDIT: MsgBox rng.Address says the range is set...I guess what the meat issue is the sort is not recognizing the declared range
Code:
Dim s As String: s = "temp"
Dim rng As Range
Set wb = ThisWorkbook
Set ws = wb.Sheets(s)
With ws
lrow = LastRow(ws) 'call function c. of de Bruin
ColNo = LastCol(ws) 'call function c. of de Bruin
ColLetter = Split(Cells(1, ColNo).Address, "$")(1)
Set rng = .Range("A1:" & ColLetter & lrow) 'vba allows a step through this
MsgBox rng.Address
Range(rng).sort key1:=Range("A1:A" & lrow), order1:=xlAscending, Header:=xlYes 'error 13 here....
End With