Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Good evening,
For the life of my I cannot figure out why my "Descend" Macro is not working properly. I checked to make sure my database name is correct, and the Columns are correct. This code works for multiple other databases, but for a strange reason is not here.
The error message I get is "Sort method of Range class failed". When the debug button is pressed it highlights
The macro I'm trying to use is:
Thank you,
For the life of my I cannot figure out why my "Descend" Macro is not working properly. I checked to make sure my database name is correct, and the Columns are correct. This code works for multiple other databases, but for a strange reason is not here.
The error message I get is "Sort method of Range class failed". When the debug button is pressed it highlights
Excel Formula:
.Columns("A:K").Sort key1:=.Range("A2"), order1:=xlDescending, Header:=xlYes
The macro I'm trying to use is:
VBA Code:
Private Sub CmdDescend_Click()
Dim xlSort As XlSortOrder
Dim LastRow As Long
With Sheets("ACTIVITY")
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("A1") = "Date"
.Columns("A:K").Sort key1:=.Range("A2"), order1:=xlDescending, Header:=xlYes
Call Submit
Call RESET
End With
MsgBox "Select Refresh Tab.", vbOKOnly + vbInformation, "Descend"
End Sub
Thank you,