+ Reply to Thread
Results 1 to 41 of 41

Row filtering based on input box entry (column heading)

  1. #1
    Registered User
    Join Date
    07-11-2005
    Posts
    6

    Row filtering based on input box entry (column heading)

    I need help to create a vba code or macro to filter data based on input box entry. In my worksheet I have 110 rows of Promo Titles. In each column (200 columns) are dollar sales goals of promo titles by Account No. This means that the column headings are Account No. I would to prompt the user using the input box to enter the Account No and the macro will filter the dollar sales goals for all promo titles of that Account No. Once filtered I would like to copy and paste the info to a new worksheet. I have searched and read a lot of posting about data filtering but I can’t find anything about row filtering based on column input box entry. Any help is greatly appreciated.

  2. #2
    Registered User
    Join Date
    07-11-2005
    Posts
    6
    Quote Originally Posted by Santed593
    I need help to create a vba code or macro to filter data based on input box entry. In my worksheet I have 110 rows of Promo Titles. In each column (200 columns) are dollar sales goals of promo titles by Account No. This means that the column headings are Account No. I would to prompt the user using the input box to enter the Account No and the macro will filter the dollar sales goals for all promo titles of that Account No. Once filtered I would like to copy and paste the info to a new worksheet. I have searched and read a lot of posting about data filtering but I can’t find anything about row filtering based on column input box entry. Any help is greatly appreciated.
    Below is the code written:

    Sub Filter_Cust()
    strCriteria = InputBox("Enter Criteria")
    If strCriteria = vbNullString Then Exit Sub

    'Create a Worksheet with the customer name and copy over all data
    Sheets("Distr").Select
    Sheets("Distr").Copy Before:=Sheets(1)
    Sheets("Distr (2)").Select
    Sheets("Distr (2)").Name = strCriteria


    Range("B1").Select

    'Look for the customer data
    Do Until ActiveCell.Value = ""
    If Trim(ActiveCell.Value) = strCriteria Then
    ActiveCell.Offset(0, 1).Range("A1").Select
    Else
    Selection.EntireColumn.Delete
    End If
    Loop

    'Check to see if customer was found
    If ActiveCell.Column = 2 Then
    Sheets(strCriteria).Select
    Application.DisplayAlerts = False
    ActiveWindow.SelectedSheets.Delete
    MsgBox "Customer not found"
    End If

    End Sub

    Any suggestion to cleanup the above code.

  3. #3
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  4. #4
    Registered User
    Join Date
    07-11-2005
    Posts
    6
    Hi Art,

    Thank you for your response. I tried the code but it is not working. What I am trying to do is, if I enter the AcctNo. (5685) iit will filter the data for that AcctNo. That means it will list down all the rows with promo titles (Column A) and corresponding goals for that account to a new worksheet. I am trying to attach an excel spreadsheet but it will not allow me. Is it possible to email this to you so can see the sample spreadsheet?

  5. #5
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  6. #6
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  7. #7
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  8. #8
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  9. #9
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  10. #10
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  11. #11
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  12. #12
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  13. #13
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  14. #14
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  15. #15
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  16. #16
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  17. #17
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  18. #18
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  19. #19
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  20. #20
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  21. #21
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  22. #22
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  23. #23
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  24. #24
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  25. #25
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  26. #26
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  27. #27
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  28. #28
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  29. #29
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  30. #30
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  31. #31
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  32. #32
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  33. #33
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  34. #34
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  35. #35
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  36. #36
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  37. #37
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  38. #38
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  39. #39
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  40. #40
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    I assumed you have Account No.1, Account No.2, etc., starting in Column B:

    Option Explicit

    Sub getAccount()
    Dim acct As Long

    Application.ScreenUpdating = False
    Sheets("Distr").Activate
    acct = Application.InputBox("Pick # for account", Type:=1)
    If acct = False Then Exit Sub
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Account No."
    & acct
    Sheets("Distr").Activate
    Range("A1").CurrentRegion.AutoFilter
    Selection.AutoFilter Field:=1 + acct, Criteria1:="<>"
    Union(Columns(1), Columns(1 + acct)).Select
    Selection.Copy Sheets("Account No." & acct).Range("A1")
    Selection.AutoFilter
    Sheets("Account No." & acct).Select
    End Sub

    CHORDially,
    Art Farrell


    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I need help to create a vba code or macro to filter data based on input
    > box entry. In my worksheet I have 110 rows of Promo Titles. In each
    > column (200 columns) are dollar sales goals of promo titles by Account
    > No. This means that the column headings are Account No. I would to
    > prompt the user using the input box to enter the Account No and the
    > macro will filter the dollar sales goals for all promo titles of that
    > Account No. Once filtered I would like to copy and paste the info to a
    > new worksheet. I have searched and read a lot of posting about data
    > filtering but I can't find anything about row filtering based on column
    > input box entry. Any help is greatly appreciated.
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




  41. #41
    Art Farrell
    Guest

    Re: Row filtering based on input box entry (column heading)

    Hi,

    Sure- mail away.

    [email protected]

    CHORDially,
    Art Farrell

    "Santed593" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi Art,
    >
    > Thank you for your response. I tried the code but it is not working.
    > What I am trying to do is, if I enter the AcctNo. (5685) iit will
    > filter the data for that AcctNo. That means it will list down all the
    > rows with promo titles (Column A) and corresponding goals for that
    > account to a new worksheet. I am trying to attach an excel spreadsheet
    > but it will not allow me. Is it possible to email this to you so can
    > see the sample spreadsheet?
    >
    >
    > --
    > Santed593
    > ------------------------------------------------------------------------
    > Santed593's Profile:

    http://www.excelforum.com/member.php...o&userid=25108
    > View this thread: http://www.excelforum.com/showthread...hreadid=394362
    >




+ Reply to Thread

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