+ Reply to Thread
Results 1 to 6 of 6

Select a range within a column

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,065

    Select a range within a column

    I want to define a range in my workbook, and can't figure out what's wrong with my syntax. Can I get some help?

    Please Login or Register  to view this content.
    Excel is saying this is invalid syntax (the bane of my existence!) but I don't understand why. I want to name the range of visible cells in column F of my Lookups worksheet. Any help is greatly appreciated.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Select a range within a column

    How about

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,065

    Re: Select a range within a column

    That one gives me a "Application Defined or Object Defined" error. Here's my full code:

    Please Login or Register  to view this content.
    here's the DeleteDups macro:
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Select a range within a column

    Hello jomili,

    Maybe this code is what you need...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,065

    Re: Select a range within a column

    Leith,

    That almost gets me there. Here's the code as I implemented it:
    Please Login or Register  to view this content.
    The problem now appears to be my "DeleteDups" macro doesn't execute, though if I step through all the code it fires quite well.

  6. #6
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,065

    Re: Select a range within a column

    I've got the PertPacs1 working for View 2, but am now having trouble with View3, as the code I'm using doesn't appear consistent in this view. Here are the pertinent macros:

    These first two are the good, working macros for View2:

    This one Filters the first column, creates named range for second - works well
    Please Login or Register  to view this content.
    This one adds the range for my second column to my "temp" worksheet, deletes the duplicates, defines the name range - works well
    Please Login or Register  to view this content.
    The next two are my attempts for View3, where we have 3 dropdown fields, so need 2 Named Ranges to populate the 2nd and 3rd dropdowns. They're basically the same as the code above, but they don't work and I can't figure out why.

    Filter the first column, create named range for second - works intermittently; haven't even tried 3rd column yet.
    Please Login or Register  to view this content.
    This one adds the range for my second column to my "temp" worksheet (it's quite alright that it overwrites what was previously there), deletes the duplicates, defines the name range - sometimes works, but usually defines the range as only containing A1, even when there are 3-4 cells in the column with discreet values. I haven't even attempted the third dropdown choice yet.
    Please Login or Register  to view this content.
    I've attached my workbook, and please let me know of any other explanation I can provide.

    Thanks,
    John
    Attached Files Attached Files
    Last edited by jomili; 12-15-2010 at 09:46 AM.

+ 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