+ Reply to Thread
Results 1 to 6 of 6

VBA to test if a cell is contained in a specific named column in a named table?

  1. #1
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    579

    VBA to test if a cell is contained in a specific named column in a named table?

    That kind of says it all...

    I have a command button that initiates a routine to get the contents of the cell to the active cell's immediate right using offset(0,1). I wish to verify that the cell that it is looking at (The final cell as located by the offset) is in a column named [Number] in a table named tbleMainInput, aka:
    Please Login or Register  to view this content.
    I want to do this much like getting the address of a cell and seeing if it is in, for instance, column "F" on the worksheet, but instead I rather know if it is in column [Number] of table tblMainInput so if I insert or delete a column before the target column the code will all still run properly.

    Thanks for thinking about it and helping me!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA to test if a cell is contained in a specific named column in a named table?

    Maybe something like this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA to test if a cell is contained in a specific named column in a named table?

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    579

    Re: VBA to test if a cell is contained in a specific named column in a named table?

    Thank-you, folks, very much, and I apologize for I must have described what I was attempting with half the explanation still in my head. Allow me to try to add something else -

    I want the code to return a value of "True" if the selected cell is in column [Number] and "False" if it isn't. I should have written that in the first place.

    As I also have a section that I need the same return simply if the cell is in the specified table, I suspect it would be dang near the same...

    My thanks!

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA to test if a cell is contained in a specific named column in a named table?

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    579

    Re: VBA to test if a cell is contained in a specific named column in a named table?

    Oooooooooooooooooooooooooooooo! THANK-YOU!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] If cell contains text contained in a named range return the row number
    By spoursy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-05-2014, 05:54 AM
  2. [SOLVED] use only 1 specific column from named range
    By Decar in forum Excel General
    Replies: 3
    Last Post: 11-28-2013, 02:05 PM
  3. Array formulas referencing a named range or named table
    By anrichards22 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-03-2013, 11:59 PM
  4. Help with determining if selection is contained in local named range
    By MI223 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-10-2013, 02:20 AM
  5. INDEX several named tables to return a specific value in the table
    By FunkyDragon in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-29-2010, 05:54 PM
  6. Replies: 2
    Last Post: 04-18-2009, 07:43 AM
  7. Replies: 1
    Last Post: 06-03-2006, 10:55 PM

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