Hi guys I'm using a sorting code it was working fine until it didn't after a while of reading though the code and testing I found that the reason for the error was because of the select which as far as I know only work when you can select the sheet first with a visible worksheet and here comes my problem I need the code to work with a hidden workbook anybody that can help with getting the code to work with hidden workbook because I only know this code. Thanks!
what the code here does is sorting after B column but it have the row 1 as header
Set tsheet = ThisWorkbook.Sheets("Courses_tee")
ThisWorkbook.Sheets("Courses_tee").Range("B2").CurrentRegion.Select
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal