Hello Excel Gurus,
Whenever I the run code below, the screen goes white for 3 seconds (or until the sorting is done) then the normal black background. What I want is to eliminate the white background while sorting the data. Any suggestion or revision or addition on the code will be appreciated
Thank you very much.
Here is the code:
Whenever I the run code below, the screen goes white for 3 seconds (or until the sorting is done) then the normal black background. What I want is to eliminate the white background while sorting the data. Any suggestion or revision or addition on the code will be appreciated
Thank you very much.
Here is the code:
VBA Code:
Sub Sort()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
With Sheets("INVTRY")
.Unprotect Password:="password"
With .Range("B4:F5000")
.Cells.Sort Key1:=.Columns(Application.Match("TR DATE", .Rows(1), 0)), Order1:=xlAscending, _
Key2:=.Columns(Application.Match("ITEM NO", .Rows(1), 0)), Order2:=xlAscending, _
key3:=.Columns(Application.Match("DESC", .Rows(1), 0)), Order3:=xlAscending, _
Orientation:=xlTopToBottom, Header:=xlYes 'comma then space then underscore then ENTER key
End With
.Protect Password:="password", DrawingObjects:=False, UserInterfaceOnly:=True, Contents:=True, _
Scenarios:=True, AllowFiltering:=True, _
AllowFormattingCells:=True, AllowSorting:=True
End With
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub