Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Sort on collumn H when leaving sheet

I would like sheet "klanten" to be sorted on collumn h when i leave this
sheet to go to an other.
Worksheet_Deactivate does not seems to do the trick becaurce i have to go
back to sheet "klanten" sort and go to the next sheet.
I end up with a loop.

Can someone help?

Greetings Hans


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Sort on collumn H when leaving sheet

Try this?

Option Explicit

Private Sub Worksheet_Deactivate()

Sheets("Klanten").Columns(8).Sort Key1:=Range("H1"),
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

End Sub

This worked for me.
Andrew Armstrong

hans wrote:
I would like sheet "klanten" to be sorted on collumn h when i leave this
sheet to go to an other.
Worksheet_Deactivate does not seems to do the trick becaurce i have to go
back to sheet "klanten" sort and go to the next sheet.
I end up with a loop.

Can someone help?

Greetings Hans


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Sort on collumn H when leaving sheet

Thanks Hans


"AndrewArmstrong" schreef in bericht
oups.com...
Try this?

Option Explicit

Private Sub Worksheet_Deactivate()

Sheets("Klanten").Columns(8).Sort Key1:=Range("H1"),
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

End Sub

This worked for me.
Andrew Armstrong

hans wrote:
I would like sheet "klanten" to be sorted on collumn h when i leave this
sheet to go to an other.
Worksheet_Deactivate does not seems to do the trick becaurce i have to go
back to sheet "klanten" sort and go to the next sheet.
I end up with a loop.

Can someone help?

Greetings Hans




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
avoid Descending Sort putting error cells uppermost in collumn Romileyrunner1 Excel Worksheet Functions 3 August 26th 09 02:41 PM
Updating workbook with an alpha sort sheet and a numeric sort shee cjlatta Excel Discussion (Misc queries) 2 January 28th 09 12:00 AM
counting if data from one collumn is present in another collumn Amelia Excel Worksheet Functions 1 February 8th 07 10:05 PM
Sort on collumn h when leaving site hans[_3_] Excel Programming 0 November 16th 06 11:21 PM
sort macro that works after leaving worksheet garyablett Excel Discussion (Misc queries) 1 May 5th 06 07:07 AM


All times are GMT +1. The time now is 03:37 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"