Results 1 to 3 of 3

Help with AdvancedFilter macro

Threaded View

  1. #1
    Registered User
    Join Date
    07-08-2009
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    Help with AdvancedFilter macro

    Hello all,

    I was wondering if anyone could help me solve an issue I'm having with creating a macro to filter some data from one sheet to another. I used the "record a macro" function to get the code I've posted below but part of the code is always changing.

    In my workbook I have a main sheet called "Data" and another sheet called "Parts". The code below does what I need it to do, but the problem is that the cell range (A2:I139) is not constant and may change depending on how many rows of information I import on the "Data" sheet.

    What I'd like to have happen is either have a dialog box pop up and prompt me to select the cell range (I've tried using the Application.InputBox function but can't figure it out), or since the first cell will always be A2 and the last column will always be I, have excel automatically figure out the last row that contains data.

    Thanks for any and all help offered.

    Mark

    Sub split()
    '
    ' split Macro
    '
    
    '
    		Worksheets("Parts").Select
    
        		Sheets("Data").Range("A2:I139").AdvancedFilter Action:=xlFilterCopy, _
            		CriteriaRange:=Sheets("Data").Range("K2:L7"), CopyToRange:=Range("A2:I2"), _
            		Unique:=False
    
    End Sub
    Last edited by Mark I; 07-09-2009 at 09:47 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