Open Worksheet Sort Data

G

Guest

When I open a worksheet (Refer To CT), I want to automatically sort a named
range by column A in descending order so that blank row are at the bottom.
The named range is "CTReferRecords". Can anyone help me with the code?
 
G

Guest

Use the sheet activate event

right click on the sheet and select view code:

Put in code like this

Private Sub Worksheet_Activate()
Dim rng As Range
Set rng = Range("CTReferRecords")
rng.Sort Key1:=rng(1), Order1:=xlAscending, _
Header:=xlYes
End Sub

I open workbooks and activate worksheets, so I may not understand your
situation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top