Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I know there is a way to have a spreadsheet sort the information you add in
to it when you save the spreadsheet. However, I cannot find the path that leads me to this option. How do I do that? |
#2
![]() |
|||
|
|||
![]()
You need VB code. Copy and paste this into the VB editor, hit Alt and F11 to
open the VB editor, double click the 'This Workbook' icon on the top left, copy and paste, hit Alt and F11 again to close the VB editor. Change the sheet and cell references to suit and xlDescending to xlAscending if required, watch out for text wrap in the e-mail, there should be three lines of code. Regards, Alan. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Sheet1.Range("A1:A30").Sort Key1:=Sheet1.Range("A1"), Order1:=xlDescending End Sub "Dena" wrote in message ... I know there is a way to have a spreadsheet sort the information you add in to it when you save the spreadsheet. However, I cannot find the path that leads me to this option. How do I do that? |
#3
![]() |
|||
|
|||
![]()
Hi Alan,
I did as described below and then went into spreadsheet, added info, clicked save and the info I added didn't sort into the rest of the spreadsheet. What did I do wrong? Do I need additional info added to VB code? Thanks "Alan" wrote: You need VB code. Copy and paste this into the VB editor, hit Alt and F11 to open the VB editor, double click the 'This Workbook' icon on the top left, copy and paste, hit Alt and F11 again to close the VB editor. Change the sheet and cell references to suit and xlDescending to xlAscending if required, watch out for text wrap in the e-mail, there should be three lines of code. Regards, Alan. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Sheet1.Range("A1:A30").Sort Key1:=Sheet1.Range("A1"), Order1:=xlDescending End Sub "Dena" wrote in message ... I know there is a way to have a spreadsheet sort the information you add in to it when you save the spreadsheet. However, I cannot find the path that leads me to this option. How do I do that? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Spreadsheet Sorts When Saved | Excel Discussion (Misc queries) | |||
How do I display the last saved date in an EXCEL spreadsheet? | Excel Discussion (Misc queries) | |||
How can I retrieve a spreadsheet closed out of (not saved)? | Excel Worksheet Functions | |||
How can I retrieve a spreadsheet closed out of (not saved)? | Excel Worksheet Functions | |||
Can I unsave a spreadsheet once it has been saved | Excel Discussion (Misc queries) |