+ Reply to Thread
Results 1 to 3 of 3

Dynamic Range Selection

Hybrid View

  1. #1
    Registered User
    Join Date
    02-18-2012
    Location
    Guilford, CT
    MS-Off Ver
    Excel 2010
    Posts
    4

    Dynamic Range Selection

    I am trying to write a Macro that will return a list of the unique values in the column above it. The number of rows will change every time, though the active cell will always be (2, 0) away from the last value in the column. I need to replace 'ActiveCell.Offset(-118, 0)' with something that will select Row 1 every time for whatever column the active cell is in. Is that 'Range(A1)? Then I need to replace 'Range("A1:A117")' with the whole whole range from the first row to two above the Active cell. It will also be the last row to have any content. I tried 'xlUp' and 'xlDown" but there may be blank cells in between and I don't know how many. I expect that it would throw it off.

    Here is what I have.


    ActiveCell.Offset(-118, 0).Range("A1:A117").AdvancedFilter Action:= _
    xlFilterCopy, CopyToRange:=ActiveCell, Unique:=True

    Thank you for the help!

  2. #2
    Registered User
    Join Date
    02-18-2012
    Location
    Guilford, CT
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Dynamic Range Selection

    That is perfect. Thank you so much.

  3. #3
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Dynamic Range Selection

    My pleasure.

    Please don't forget to mark the thread solved.
    Good luck.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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