Results 1 to 3 of 3

Modifying sort data macro

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Modifying sort data macro

    I have the following macro that sorts column G and H ascending so that the rows with "Yes" in column G and H come to the top. Next I would like to copy all rows with a Yes in them into B50 and all rows without a yes in column G or H into B100. Can someone help me finish this macro?

    
    
    
    
    
    Sub Filter()
      
       Application.ScreenUpdating = False
       
       Dim Wks As Worksheet
        Set Wks = ActiveSheet
        Wks.Activate
        
        Filter2
        
        Application.ScreenUpdating = True
    End Sub
    
    
    
    
    
    Private Sub Filter2()
    'First line
    Dim i As Long, LR As Long
    
    i = 446
    
    Range("B3:BY4").AutoFilter
    Selection.Sort Key1:=Range("G4"), Order1:=xlAscending, Header:= _
    xlGuess, Orientation:=xlTopToBottom
    Selection.Sort Key1:=Range("H4"), Order1:=xlAscending, Header:= _
    xlGuess, Orientation:=xlTopToBottom
    
    
    
    
    ActiveSheet.AutoFilterMode = False
    Application.CutCopyMode = False
        
    
    End Sub
    Attached Files Attached Files

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