Quantcast
Viewing all articles
Browse latest Browse all 50079

Auto sort a table with formulas

Hi,

I have a adjusting table which auto sorts based on the latest weeks results.

Using the following code

Code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
   
    Range("B5:H9").Sort Key1:=Range("G5:G9"), Order1:=xlDescending, _
    Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

End Sub

If one of the results is an N/A (There is no data for the site that week, the table will auto sort this value to the top. How do i get it to move any errors to the button of the table?

I've attached a sample worksheet
Attached Files

Viewing all articles
Browse latest Browse all 50079

Trending Articles