Results 1 to 3 of 3

Macro to manually input which field (column) to autofilter on using an input prompt

Threaded View

rin Macro to manually input which... 06-21-2012, 09:04 AM
arlu1201 Re: Macro to manually input... 06-21-2012, 09:25 AM
rin Re: Macro to manually input... 06-21-2012, 09:35 AM
  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    oxford, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Macro to manually input which field (column) to autofilter on using an input prompt

    Hi,

    I have a worksheet that shows me items & their delivery frequency - Items are in column A and weeks across the top. Each items row has an X in the corresponding week that it needs to be delivered.
    I'm trying to write a macro that copy's everything from a specific week into a new sheet, with the user inputting which week they require. I've sorted everything except the part where the user can input which weeks required. I found some code (below) that allowed the user to input the criteria of the auto filter - is there any way to do a similar thing except changing the field number - the criteria should always be X.

    uiWeekToShow = Application.InputBox("Show which Week", Type:=2)
    If uiWeekToShow = "False" Then Exit Sub: Rem Cancel pressed
    
    Range("B1:BA2387").Select
    Selection.AutoFilter Field:=1, Criteria1:="<>" & uiWeekToShow, Operator:=xlAnd
    I hope this makes sense to someone!?

    THanks
    Barney.
    Last edited by rin; 06-21-2012 at 09:36 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