+ Reply to Thread
Results 1 to 3 of 3

dynamic range - sort

  1. #1
    Registered User
    Join Date
    02-01-2007
    Posts
    39

    Talking dynamic range - sort

    I am creating a button on top of column A which will provide Sort capability. Clicking on this button will allow me to sort the worksheet based on Column A. The problem is that the data is continously changing on this worksheet. Today there might be 10 columns but tommorrow, I might have 20 columns. In addition, as far as the rows goes - the data which should be sorted is up until the point it encounters a blank row. Is there a simple sort function that I can use to accomplish this?

    Or, how can I check for a blank row? Secondly, How can I handle the dynamic range of columns?

    Thanks much !

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    You can define the database range with a "dynamic range" i.e a range which adjusts itself automatically ...

    Insert Name Define
    give your range a name
    in the formula area type
    =Offset(Sheet1!$A$1,0,0,Counta(Sheet1!$A:$A),Counta(Sheet1!$1:$1))
    HTH
    Carim


    Top Excel Links

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi

    This might help

    Please Login or Register  to view this content.
    http://www.contextures.com/xlNames01.html#Dynamic

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ 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