Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Sort single column

I would like to be able to sort Column A by it's self from the top to whatever the last cell entry falls, ignoring all the other columns. Is there a macro around that will do that? TIA

--

Regards
Michael Koerner


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Sort single column

If you are new to macros Set the Security level to low/medium in
(Tools|Macro|Security). 'Launch VBE using short-key Alt+F11. On the left
treeview right click 'This Workbook '. Paste this code and save. Get back to
Workbook.
This will sort Column A everytime you open your workbook.

Private Sub Workbook_Open()
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A:A")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Michael Koerner" wrote:

I would like to be able to sort Column A by it's self from the top to whatever the last cell entry falls, ignoring all the other columns. Is there a macro around that will do that? TIA

--

Regards
Michael Koerner


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Sort single column

Jacob;

Thank you very much. I have a couple of questions.

1. I have a header row can I change xlNo to xlYes?
2. The workbook sheet is 4 and named ItemList Can I use either 4 or ItemList
3. I realize the macro runs every time the workbook is opened. Which is not needed. I presume I can I run it whenever I make changes to that particular sheet?

--

Regards
Michael Koerner


"Jacob Skaria" wrote in message ...
If you are new to macros Set the Security level to low/medium in
(Tools|Macro|Security). 'Launch VBE using short-key Alt+F11. On the left
treeview right click 'This Workbook '. Paste this code and save. Get back to
Workbook.
This will sort Column A everytime you open your workbook.

Private Sub Workbook_Open()
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A:A")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Michael Koerner" wrote:

I would like to be able to sort Column A by it's self from the top to whatever the last cell entry falls, ignoring all the other columns. Is there a macro around that will do that? TIA

--

Regards
Michael Koerner


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Sort single column

Dear Michael

Please find the below comments. Hope this helps or else postback. Cheers

If this post helps click Yes
---------------
Jacob Skaria


"Michael Koerner" wrote:

Jacob;

Thank you very much. I have a couple of questions.

1. I have a header row can I change xlNo to xlYes?

Yes you can
2. The workbook sheet is 4 and named ItemList Can I use either 4 or ItemList

You can either reference as Worksheets(4). or Worksheets("ItemList").
3. I realize the macro runs every time the workbook is opened. Which is not needed. I presume I can I run it whenever I make changes to that particular sheet?

In VBE (Alt+F11) under the VBA project Treeview double click ThisWorkBook.
Cut and paste the code from _Open to '_SheetChange' or 'Before Save' event as
required...


--

Regards
Michael Koerner


"Jacob Skaria" wrote in message ...
If you are new to macros Set the Security level to low/medium in
(Tools|Macro|Security). 'Launch VBE using short-key Alt+F11. On the left
treeview right click 'This Workbook '. Paste this code and save. Get back to
Workbook.
This will sort Column A everytime you open your workbook.

Private Sub Workbook_Open()
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A:A")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Michael Koerner" wrote:

I would like to be able to sort Column A by it's self from the top to whatever the last cell entry falls, ignoring all the other columns. Is there a macro around that will do that? TIA

--

Regards
Michael Koerner


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Sort single column

Jacob;

Thank you very much

--

Regards
Michael Koerner


"Jacob Skaria" wrote in message ...
Dear Michael

Please find the below comments. Hope this helps or else postback. Cheers

If this post helps click Yes
---------------
Jacob Skaria


"Michael Koerner" wrote:

Jacob;

Thank you very much. I have a couple of questions.

1. I have a header row can I change xlNo to xlYes?

Yes you can
2. The workbook sheet is 4 and named ItemList Can I use either 4 or ItemList

You can either reference as Worksheets(4). or Worksheets("ItemList").
3. I realize the macro runs every time the workbook is opened. Which is not needed. I presume I can I run it whenever I make changes to that particular sheet?

In VBE (Alt+F11) under the VBA project Treeview double click ThisWorkBook.
Cut and paste the code from _Open to '_SheetChange' or 'Before Save' event as
required...


--

Regards
Michael Koerner


"Jacob Skaria" wrote in message ...
If you are new to macros Set the Security level to low/medium in
(Tools|Macro|Security). 'Launch VBE using short-key Alt+F11. On the left
treeview right click 'This Workbook '. Paste this code and save. Get back to
Workbook.
This will sort Column A everytime you open your workbook.

Private Sub Workbook_Open()
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A:A")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Michael Koerner" wrote:

I would like to be able to sort Column A by it's self from the top to whatever the last cell entry falls, ignoring all the other columns. Is there a macro around that will do that? TIA

--

Regards
Michael Koerner


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
From single cell variables to a single column serie noyau New Users to Excel 1 December 22nd 06 06:43 AM
Sort across a single row Scott P Excel Programming 2 April 27th 06 08:51 PM
Sort across a single row Scott P Excel Programming 1 April 27th 06 08:44 PM
Copy column range of "single word" cells with spaces to a single c nastech Excel Discussion (Misc queries) 3 February 15th 06 05:04 PM
Return Single Row of Numeric Data to Single Column Sam via OfficeKB.com Excel Worksheet Functions 4 December 17th 05 12:31 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"