Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3672074
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:33:52+00:00 2026-05-19T02:33:52+00:00

Awesome Stackoverflow users, I am having difficulty with something that seems simple enough to

  • 0

Awesome Stackoverflow users,

I am having difficulty with something that seems simple enough to not cause this much trouble. I am trying to filter a given sheet based on a criteria. Here is the code:

Sub FilterWorksheet(sCriteria As String)
  'First, clear the filter
  ThisWorkbook.Worksheets("MyAwesomeSheet").AutoFilterMode = False

  'Then apply the filter for the Transfer_From_seg column
  ThisWorkbook.Worksheets("MyAwesomeSheet").AutoFilter Field:=2, Criteria1:=sCriteria
End Sub

For some reason, the last line where I actually apply the filter keeps giving me the following error message:

Runtime Error '448'

Named argument not found

Am I doing something really stupid with this?

Thanks!

Update:

So I found a solution. Here is what it looks like:

Sub FilterWorksheet(sCriteria As String)
  'First, clear the filter
  ThisWorkbook.Worksheets("MyAwesomeSheet").AutoFilterMode = False

  'Then apply the filter for the Transfer_From_seg column
  ThisWorkbook.Worksheets("MyAwesomeSheet").Range("A:H").AutoFilter Field:=2, Criteria1:=sCriteria
End Sub

I am not quite sure why this works & the previous one does not so if someone can explain it to me, that would be wonderful. Thanks again!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:33:53+00:00Added an answer on May 19, 2026 at 2:33 am

    You need to specify the Range that you want to filter. For example:

    ThisWorkbook.Worksheets("MyAwesomeSheet").Range("B3:C11").AutoFilter field:=2, Criteria1:=sCriteria
    

    Autofilter Method in the Excel 2003 VBA Language Reference

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ffdshow has this awesome little API for controlling playback of video files. It allows
I've heard that unit testing is totally awesome, really cool and all manner of
Hopefully quite a simple one, having my first try at WPF with Prism V2
The new awesome Ctrl + . keyboard shortcut to show smart tags has suddenly
I'm currently using the awesome attachment-fu plugin for a Rails app, but as a
I've been tasked with the awesome job of generating a look-up table for our
In Firefox you can enter the following into the awesome bar and hit enter:
I've recently began using dTrace and have noticed just how awesome it is. Its
I'm doing some funky authentication work (and yes, I know, open-id is awesome, but
My application will have a per machine (not per user) Startup shortcut. I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.