Consulting

Results 1 to 2 of 2

Thread: Solved: Creating Dynamic Named Range

  1. #1
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,676
    Location

    Solved: Creating Dynamic Named Range

    I'm trying to create a dynamic named range through the Define Name dialog box. MD posted a great example of how to do this when your named range is vertical, but now I'm trying to create a horizontal dynamic named range.

    The range starts at G2 and I want to set it so that it will count left from IV2 to the last used cell. Here's the function I thought would work based on studying MD's example:
    [vba]=OFFSET(Sheet1!$G$2,0,0,0,COUNTA(Sheet1!$G2:$IV2))[/vba]

    Where am I going wrong?
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    =OFFSET(Sheet1!$G$2,0,0,1,COUNTA(Sheet1!$G$2:$IV$2))
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •