+ Reply to Thread
Results 1 to 4 of 4

UserForm Range

  1. #1
    Registered User
    Join Date
    06-03-2009
    Location
    N.Ireland
    MS-Off Ver
    Excel 2003
    Posts
    76

    UserForm Range

    I am trying to work my way through some vb with excel userform tutorials and i have came across an example that uses a range to populate the userform, i was wondering if anyone would be kind enough to break this line down for me, i have got myself into abit of a muddle:

    =OFFSET(Data!$A$1,1,MATCH("Age",Data!$1:$1,0)-1,COUNTA(Data!$A:$A)-1,1)


    Many thanks

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,641

    re: UserForm Range

    Hi there,

    As you say in your post, this formula defines a worksheet range.

    The details are as follows:
    start from Cell A1 on the "Data" worksheet,
    scan across Row 1 of this worksheet until a cell containing the text value "Age" is located,
    scan down Column A and count how many cells in that column contain values,
    subtract 1 from the above value (probably to exclude the header row), - let's refer to this value as "x",
    finally, take the "x" cells below the cell containing "Age", and this is the range you're looking for.
    To get a quick indication of how it works, use:
    Please Login or Register  to view this content.
    to calculate the sum of all of the ages in the range.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    06-03-2009
    Location
    N.Ireland
    MS-Off Ver
    Excel 2003
    Posts
    76

    Smile re: UserForm Range

    Greg thankyou so much for your help, it make so much more sense now, i tried your sample and it worked well, thank you for the explanation
    Last edited by shg; 06-15-2009 at 09:52 AM. Reason: deleted spurious quote

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,641

    Re: UserForm Range

    Hi again, fellow Irishman!

    Many thanks for your feedback - I'm glad I was able to help.

    Regards,

    Greg M

+ 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