Results 1 to 3 of 3

Automatically reapply filter based on date

Threaded View

  1. #1
    Registered User
    Join Date
    07-15-2010
    Location
    Amsterdam, Holland
    MS-Off Ver
    Excel 2007
    Posts
    5

    Automatically reapply filter based on date

    Hey Guys,

    After the last thread in which rows conditionally had to be copied out of a database into tabs, which succeeded thanks to the help on the forum, I want the database to be better organised. I'm looking for a macro which will automatically order the rows in the database according to the date of offer. Now reapply has to be used and I will think the people who will use this model will forget this.

    I have not got any knowledge about macro's and when searching I found this one:

    Private Sub Database(ByVal Sh As Object, ByVal Target As Range)
         
        If Intersect(Sh.Range("B2:B100"), Target) Is Nothing Then Exit Sub
         
        If Sh.FilterMode = True Then
            With Application
                .EnableEvents = False
                .ScreenUpdating = False
            End With
             
            With ActiveWorkbook
                .CustomViews.Add ViewName:="Mine", RowColSettings:=True
                Sh.AutoFilterMode = False
                .CustomViews("Mine").Show
                .CustomViews("Mine").Delete
            End With
             
            With Application
                .EnableEvents = True
                .ScreenUpdating = True
            End With
        End If
         
    End Sub
    So the database-order needs to be adjusted dependent of the data in column B. The code was intered in the 'view code' screen of the database tab. I hope I made my question clear and you can help me with this one.

    Looking forward to an answer,
    Floris
    Attached Files Attached Files
    Last edited by Floris; 07-26-2010 at 05:57 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1