Option Explicit
Sub Sort()
Application.ScreenUpdating = False
'Set current sheet for resetting later
Dim OriginalSheet As String
OriginalSheet = ActiveSheet.Name
'Sort all cells (assumes time is in column A)
Range("A1", Cells(ActiveSheet.Rows.Count, ActiveSheet.Columns.Count)).Sort _
Key1:=Range("A3"), Order1:=xlAscending, Header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
'copy requried columns into new sheet
Range("A1:G50,Y1:Y50,AA1:AB50").Copy
Sheets.Add Before:=Sheets(1)
ActiveSheet.Paste
Application.CutCopyMode = False
'publish html in c drive
ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _
"C:\Test.html", ActiveSheet.Name, "", xlHtmlStatic).Publish (True)
'delete the created sheet
Application.DisplayAlerts = False
Sheets(ActiveSheet.Name).Delete
Application.DisplayAlerts = True
'reset selected sheet
Sheets(OriginalSheet).Select
Application.ScreenUpdating = True
End Sub