Specifying range in VBA macrosHow to get the starting and ending rownum when using EXCEL Autofilter function in VBAHow to avoid using Select in Excel VBAAutofilter in VBA with criteria as a range of cells'No Cells' After applying autofilter: Excel VBAExcel Macro for multiple filterCopy AutoFiltered Data Loop Until EndSelecting a Range in filtered data - Excel VBAEXCEL VBA Not exact match auto filterFiltering a macro with several valuesVBA Excel | Filter multuple columns based on single value

Who was the lone kid in the line of people at the lake at the end of Avengers: Endgame?

How to prevent z-fighting in OpenSCAD?

Why does nature favour the Laplacian?

Betweenness centrality formula

Minor Revision with suggestion of an alternative proof by reviewer

How to denote matrix elements succinctly?

Implications of cigar-shaped bodies having rings?

What is the smallest unit of eos?

Check if a string is entirely made of the same substring

Apply MapThread to all but one variable

Can SQL Server create collisions in system generated constraint names?

Was there a Viking Exchange as well as a Columbian one?

What term is being referred to with "reflected-sound-of-underground-spirits"?

Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?

Is Diceware more secure than a long passphrase?

On The Origin of Dissonant Chords

What are the steps to solving this definite integral?

Do I have an "anti-research" personality?

Converting a sprinkler system's 24V AC outputs to 3.3V DC logic inputs

Don’t seats that recline flat defeat the purpose of having seatbelts?

How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?

Could the terminal length of components like resistors be reduced?

How to display Aura JS Errors Lightning Out

What is the most expensive material in the world that could be used to create Pun-Pun's lute?



Specifying range in VBA macros


How to get the starting and ending rownum when using EXCEL Autofilter function in VBAHow to avoid using Select in Excel VBAAutofilter in VBA with criteria as a range of cells'No Cells' After applying autofilter: Excel VBAExcel Macro for multiple filterCopy AutoFiltered Data Loop Until EndSelecting a Range in filtered data - Excel VBAEXCEL VBA Not exact match auto filterFiltering a macro with several valuesVBA Excel | Filter multuple columns based on single value






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am really new to VBA. SO this might seem a silly question for experts.



after researching the internet on how to put dynamic range for filters in excel considering a situation when your list might grow or shrink I stumbled on couple of ways. One of them is as the following.



ActiveSheet.Range("A1").AutoFilter Field:=46, Criteria1:="1"



I know the you can put two arguments to specify ranges and the second one is optional. In this particular I am just putting the first cell where my data starts. My questions are below:



  1. does the code automatically select the active range based on the first specified cell?

  2. Had my data started from "C5" would i still have to chose the argument as "A1"?

  3. I am filtering out something from column 46. what does it matter where I specify my first cell? for example if I had chosen "C5" instead of "A1" how it would have affected my macro?

  4. Let's say, I want to filter out something from column 2 ie, Field 2. But the argument for range I choose as "D5". How it would affect my macro code?









share|improve this question

















  • 2





    My answer is to find out for yourself! Testing this yourself will allow you to actually see what happens when you tweak the available options available to you from the Range.Autofilter method. While we could show you, doing it yourself is a great learning exp and you are much more likely to remember the results after seeing them.

    – urdearboy
    Mar 22 at 18:04


















0















I am really new to VBA. SO this might seem a silly question for experts.



after researching the internet on how to put dynamic range for filters in excel considering a situation when your list might grow or shrink I stumbled on couple of ways. One of them is as the following.



ActiveSheet.Range("A1").AutoFilter Field:=46, Criteria1:="1"



I know the you can put two arguments to specify ranges and the second one is optional. In this particular I am just putting the first cell where my data starts. My questions are below:



  1. does the code automatically select the active range based on the first specified cell?

  2. Had my data started from "C5" would i still have to chose the argument as "A1"?

  3. I am filtering out something from column 46. what does it matter where I specify my first cell? for example if I had chosen "C5" instead of "A1" how it would have affected my macro?

  4. Let's say, I want to filter out something from column 2 ie, Field 2. But the argument for range I choose as "D5". How it would affect my macro code?









share|improve this question

















  • 2





    My answer is to find out for yourself! Testing this yourself will allow you to actually see what happens when you tweak the available options available to you from the Range.Autofilter method. While we could show you, doing it yourself is a great learning exp and you are much more likely to remember the results after seeing them.

    – urdearboy
    Mar 22 at 18:04














0












0








0








I am really new to VBA. SO this might seem a silly question for experts.



after researching the internet on how to put dynamic range for filters in excel considering a situation when your list might grow or shrink I stumbled on couple of ways. One of them is as the following.



ActiveSheet.Range("A1").AutoFilter Field:=46, Criteria1:="1"



I know the you can put two arguments to specify ranges and the second one is optional. In this particular I am just putting the first cell where my data starts. My questions are below:



  1. does the code automatically select the active range based on the first specified cell?

  2. Had my data started from "C5" would i still have to chose the argument as "A1"?

  3. I am filtering out something from column 46. what does it matter where I specify my first cell? for example if I had chosen "C5" instead of "A1" how it would have affected my macro?

  4. Let's say, I want to filter out something from column 2 ie, Field 2. But the argument for range I choose as "D5". How it would affect my macro code?









share|improve this question














I am really new to VBA. SO this might seem a silly question for experts.



after researching the internet on how to put dynamic range for filters in excel considering a situation when your list might grow or shrink I stumbled on couple of ways. One of them is as the following.



ActiveSheet.Range("A1").AutoFilter Field:=46, Criteria1:="1"



I know the you can put two arguments to specify ranges and the second one is optional. In this particular I am just putting the first cell where my data starts. My questions are below:



  1. does the code automatically select the active range based on the first specified cell?

  2. Had my data started from "C5" would i still have to chose the argument as "A1"?

  3. I am filtering out something from column 46. what does it matter where I specify my first cell? for example if I had chosen "C5" instead of "A1" how it would have affected my macro?

  4. Let's say, I want to filter out something from column 2 ie, Field 2. But the argument for range I choose as "D5". How it would affect my macro code?






excel vba






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 17:25









sbash005sbash005

6




6







  • 2





    My answer is to find out for yourself! Testing this yourself will allow you to actually see what happens when you tweak the available options available to you from the Range.Autofilter method. While we could show you, doing it yourself is a great learning exp and you are much more likely to remember the results after seeing them.

    – urdearboy
    Mar 22 at 18:04













  • 2





    My answer is to find out for yourself! Testing this yourself will allow you to actually see what happens when you tweak the available options available to you from the Range.Autofilter method. While we could show you, doing it yourself is a great learning exp and you are much more likely to remember the results after seeing them.

    – urdearboy
    Mar 22 at 18:04








2




2





My answer is to find out for yourself! Testing this yourself will allow you to actually see what happens when you tweak the available options available to you from the Range.Autofilter method. While we could show you, doing it yourself is a great learning exp and you are much more likely to remember the results after seeing them.

– urdearboy
Mar 22 at 18:04






My answer is to find out for yourself! Testing this yourself will allow you to actually see what happens when you tweak the available options available to you from the Range.Autofilter method. While we could show you, doing it yourself is a great learning exp and you are much more likely to remember the results after seeing them.

– urdearboy
Mar 22 at 18:04













1 Answer
1






active

oldest

votes


















0














AutoFilter: A Small Study



  • Well, I was curious, too. So I studied it a little bit and created a
    workbook where you can input the parameters of some of the arguments
    of the AutoFilter method and just by clicking on a command button
    apply the changes. The next click removes the filter.

  • The workbook also contains the results of the behavior when changing
    by row. The same thing could be done by column.


  • Workbook
    Download
    (Dropbox)

The following image displays the initial state of the only worksheet in the workbook.



enter image description here



This I was most curious about: what would happen if I would filter in C8. There's a surprise.



enter image description here



There still remains a ton of unanswered questions, but this could get you started to investigate deeper.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55304876%2fspecifying-range-in-vba-macros%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    AutoFilter: A Small Study



    • Well, I was curious, too. So I studied it a little bit and created a
      workbook where you can input the parameters of some of the arguments
      of the AutoFilter method and just by clicking on a command button
      apply the changes. The next click removes the filter.

    • The workbook also contains the results of the behavior when changing
      by row. The same thing could be done by column.


    • Workbook
      Download
      (Dropbox)

    The following image displays the initial state of the only worksheet in the workbook.



    enter image description here



    This I was most curious about: what would happen if I would filter in C8. There's a surprise.



    enter image description here



    There still remains a ton of unanswered questions, but this could get you started to investigate deeper.






    share|improve this answer



























      0














      AutoFilter: A Small Study



      • Well, I was curious, too. So I studied it a little bit and created a
        workbook where you can input the parameters of some of the arguments
        of the AutoFilter method and just by clicking on a command button
        apply the changes. The next click removes the filter.

      • The workbook also contains the results of the behavior when changing
        by row. The same thing could be done by column.


      • Workbook
        Download
        (Dropbox)

      The following image displays the initial state of the only worksheet in the workbook.



      enter image description here



      This I was most curious about: what would happen if I would filter in C8. There's a surprise.



      enter image description here



      There still remains a ton of unanswered questions, but this could get you started to investigate deeper.






      share|improve this answer

























        0












        0








        0







        AutoFilter: A Small Study



        • Well, I was curious, too. So I studied it a little bit and created a
          workbook where you can input the parameters of some of the arguments
          of the AutoFilter method and just by clicking on a command button
          apply the changes. The next click removes the filter.

        • The workbook also contains the results of the behavior when changing
          by row. The same thing could be done by column.


        • Workbook
          Download
          (Dropbox)

        The following image displays the initial state of the only worksheet in the workbook.



        enter image description here



        This I was most curious about: what would happen if I would filter in C8. There's a surprise.



        enter image description here



        There still remains a ton of unanswered questions, but this could get you started to investigate deeper.






        share|improve this answer













        AutoFilter: A Small Study



        • Well, I was curious, too. So I studied it a little bit and created a
          workbook where you can input the parameters of some of the arguments
          of the AutoFilter method and just by clicking on a command button
          apply the changes. The next click removes the filter.

        • The workbook also contains the results of the behavior when changing
          by row. The same thing could be done by column.


        • Workbook
          Download
          (Dropbox)

        The following image displays the initial state of the only worksheet in the workbook.



        enter image description here



        This I was most curious about: what would happen if I would filter in C8. There's a surprise.



        enter image description here



        There still remains a ton of unanswered questions, but this could get you started to investigate deeper.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 22 at 20:16









        VBasic2008VBasic2008

        3,5372517




        3,5372517





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55304876%2fspecifying-range-in-vba-macros%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript