Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mia Mia is offline
external usenet poster
 
Posts: 101
Default Autofilter-sorting from specified cell

Hello,

I´m trying to with autofilter, everything i working fine but I want to sort
after a specified cell, in this case D5. Do anyone know how to do this?



My code is:

Sub Januari()
'
' Sortera januari i betaltlistan Makro
'
'
ActiveSheet.Unprotect

ActiveSheet.ListObjects("Tabell1012").Range.AutoFi lter
ActiveSheet.ListObjects("Tabell1012").Range.AutoFi lter Field:=5,
Criteria1 _
:="$D5"

ActiveSheet.ListObjects("Tabell1012").Range.AutoFi lter Field:=32,
Criteria1 _
:="<"

End Sub


Keep my fingers krossed.

BR
Mia
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mia Mia is offline
external usenet poster
 
Posts: 101
Default Autofilter-sorting from specified cell

If someones intrested, I solved it myself. I used following code:

Sub Januari()
'
' Sortera januari i betaltlistan Makro
'
'
ActiveSheet.Unprotect

Dim val As String
val = ActiveSheet.Range("D5")


ActiveSheet.ListObjects("Tabell101226").Range.Auto Filter
ActiveSheet.ListObjects("Tabell101226").Range.Auto Filter Field:=5,
Criteria1 _
:=val


ActiveSheet.ListObjects("Tabell101226").Range.Auto Filter Field:=32,
Criteria1 _
:="<"


End Sub




"Mia" skrev:

Hello,

I´m trying to with autofilter, everything i working fine but I want to sort
after a specified cell, in this case D5. Do anyone know how to do this?



My code is:

Sub Januari()
'
' Sortera januari i betaltlistan Makro
'
'
ActiveSheet.Unprotect

ActiveSheet.ListObjects("Tabell1012").Range.AutoFi lter
ActiveSheet.ListObjects("Tabell1012").Range.AutoFi lter Field:=5,
Criteria1 _
:="$D5"

ActiveSheet.ListObjects("Tabell1012").Range.AutoFi lter Field:=32,
Criteria1 _
:="<"

End Sub


Keep my fingers krossed.

BR
Mia

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
Enabling Autofilter and Sorting in a Protected Sheet [email protected] Excel Discussion (Misc queries) 2 January 3rd 12 07:14 PM
2007 excel autofilter change back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 05:53 PM
Autofilter/Sorting Copying Wrong records Sandi Excel Discussion (Misc queries) 3 January 22nd 07 11:28 PM
Sorting after autofilter Dave Peterson Excel Programming 0 December 13th 06 12:30 AM
Sorting with AutoFilter m.cain Excel Discussion (Misc queries) 1 March 24th 06 01:56 PM


All times are GMT +1. The time now is 02:34 PM.

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

About Us

"It's about Microsoft Excel"