+ Reply to Thread
Results 1 to 7 of 7

Range selection

  1. #1
    Registered User
    Join Date
    07-30-2013
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    4

    Wink Range selection

    Hello world,

    I am quite new to vba and I am trying to build a 3 step macro that will

    1- separate values ("deconcatenate them") from a given column in a different location on the same sheet
    2-Filter these values so that I get a list of unique values
    3-Count the occurences of each unique value

    The macro is quite simple, i actually did not write it myself except for step 2. And the glitch is in... step 2.

    Please Login or Register  to view this content.
    At line
    Please Login or Register  to view this content.
    i am returned the error "438, method does not support this object"
    The thing is that i am trying to select only the non-void cells to filter them.

    Big love for your help !!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Range selection

    I'm afraid that bit of code doesn't make a lot of sense to me. What are you actually trying to achieve. Why are you doing 65000 loops before doing advanced filter?

  3. #3
    Registered User
    Join Date
    07-30-2013
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Range selection

    The file as it is now has 50 lines of data, but it may have 100 or 1000 in the future. I want the macro to adapt and select all the lines resulting from step 1 (hence the loop), but some of these lines will be 3-column large, while other will be 1-column large or 5-column large (hence the .EndToRight).

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Range selection

    Which cells in plain English are you trying to advanced filter? It won't work across varying numbers of multiple columns.

  5. #5
    Registered User
    Join Date
    07-30-2013
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Range selection

    The cells resulting from the step 1 conversion, which will spread in the range "Z3:AH65536". Some initial cells might contain up to 5 different values, so there will be 5 resulting columns at the end of step 1, other initial cells will just contain 1 value etc...

    So if filtering does not work across varying numbers of multiple columns, which other function can i use ?

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Range selection

    If they're always in Z:AH, this:
    Please Login or Register  to view this content.
    Last edited by StephenR; 07-31-2013 at 10:16 AM.

  7. #7
    Registered User
    Join Date
    07-30-2013
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Range selection

    It works just fine and you are just great. I had never heard about scripting dictionnary before !
    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled row
    By looney in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-12-2013, 10:51 AM
  2. Replies: 2
    Last Post: 04-20-2012, 12:23 PM
  3. Hide rows in range 2 based on filter selection in range 1
    By gtol in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-28-2012, 02:09 PM
  4. Selecting range using .range. But can you do same selection using .columns
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-01-2011, 01:31 PM
  5. Range selection based on adjacent cell range
    By iguss in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-20-2008, 07:57 AM

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