I'm trying to sort a range of data by a custom list the code is below. i first create a customlist then sort a range based on that list
Sub CustomListAddCount()
Dim iCustListNum As Integer
With Sheets("Blank With Part (2 Columns)")
If .Range("AQ19") <> "Done" Then
iCustListNum = Application.CustomListCount + 1
Application.AddCustomList .Range("AQ20:AQ201")
.Range("AQ19") = "Done"
Sheets("Blank With Part (2 Columns)") = iCustListNum
End If
End With
End Sub
Sub CatagoryCount()
Dim iOrderCustom As Integer
Run "ThisWorkbook.CustomListAddCount"
iOrderCustom = Sheets("Blank With Part (2 Columns)").Sheets("Blank With Part (2 Columns)")
Range("AI7:AL383").Sort Key1:=Range("AI7"), OrderCustom:=iOrderCustom, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
i took this code from another post and changed it up to fit what i need its tell me Run-time error '438': Object doesn't support this property or method. when stepping through this line
iOrderCustom = Sheets("Blank With Part (2 Columns)").Sheets("Blank With Part (2 Columns)")
i dont really understand how that line works so i dont know whats wrong with it.
Bookmarks