Results 1 to 15 of 15

filtering data if have X value, if not then filter with Y

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    filtering data if have X value, if not then filter with Y

    Hi,

    i have the following code

    Sub CartCtype()
    
    
    With Sheets("input_sheet")
    
    Application.ScreenUpdating = False
    
       
           bottomA = .Range("A" & .Rows.Count).End(xlUp).Row
        
           For x = 2 To bottomA
           
            
               
               If .Cells(x, "A") = "10*" Then
                   .AutoFilter field:=1, Criteria1:="10_C*"
                
                   
               ElseIf .Cells(x, "A") = "20*" Then
                   .AutoFilter field:=1, Criteria1:="20_C*"
                   
    End If
    
    Next x
    
    End With
    
    End Sub
    What I want is, by clicking on the CartCType button, the macro will check in columns A if it contain 10*...if it does, then filter it with only this criteria 10_C*

    if it does contain 20, then filter if with 20_C*

    Any help??
    Last edited by extremis; 08-15-2013 at 02:15 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 9
    Last Post: 07-02-2020, 11:48 AM
  2. Date Filter is not working, beside filtering data also needs some help.
    By sanc.jobs2012 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-14-2012, 05:51 AM
  3. Replies: 3
    Last Post: 05-15-2011, 11:46 AM
  4. Replies: 0
    Last Post: 08-24-2010, 06:51 PM
  5. Filtering Data & Auto-filter
    By Henry c in forum Excel General
    Replies: 10
    Last Post: 05-07-2010, 09:15 PM

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