ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   sorting macro (https://www.excelbanter.com/excel-programming/273230-sorting-macro.html)

Beth Mc[_2_]

sorting macro
 
I need to sort a column ascending upon closing the
workbook.. I got it started with an Auto_Close macro.
However G2 contains my heading, G1 contains my title, and
G3 is where my data starts, so I keep getting a debugging
error.

Sometimes it runs the sort without giving me a debugging
error, but then it is moving the header row of A2:G2 below
the data when it sorts. So instead of A2:G2 showing the
column headers, the column headers are moved to A11:G11
and the data is sorted (correctly) in A2:G10. The column
headers for H2:P2 stay in the same place.

Thanks for the help,
Beth



Donald Lloyd

sorting macro
 
Beth
Insrt a blank row between the title and the headings.
Don
--

"Beth Mc" wrote in message
...
I need to sort a column ascending upon closing the
workbook.. I got it started with an Auto_Close macro.
However G2 contains my heading, G1 contains my title, and
G3 is where my data starts, so I keep getting a debugging
error.

Sometimes it runs the sort without giving me a debugging
error, but then it is moving the header row of A2:G2 below
the data when it sorts. So instead of A2:G2 showing the
column headers, the column headers are moved to A11:G11
and the data is sorted (correctly) in A2:G10. The column
headers for H2:P2 stay in the same place.

Thanks for the help,
Beth





Dave Peterson[_3_]

sorting macro
 
See one more guess at your original post.

Beth Mc wrote:

I need to sort a column ascending upon closing the
workbook.. I got it started with an Auto_Close macro.
However G2 contains my heading, G1 contains my title, and
G3 is where my data starts, so I keep getting a debugging
error.

Sometimes it runs the sort without giving me a debugging
error, but then it is moving the header row of A2:G2 below
the data when it sorts. So instead of A2:G2 showing the
column headers, the column headers are moved to A11:G11
and the data is sorted (correctly) in A2:G10. The column
headers for H2:P2 stay in the same place.

Thanks for the help,
Beth


--

Dave Peterson



All times are GMT +1. The time now is 05:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com