+ Reply to Thread
Results 1 to 8 of 8

Refer to a cell in another column within a 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
    583

    Refer to a cell in another column within a table

    We have a table, call it tblTable for now.

    Once created, it has some blank cells in one of it's columns.

    Using the code below I am finding each blank cell. I need the code to insert in the for-next loop to extract the first left 3 characters from another column in the same table, the other column's name is "Student".

    Please Login or Register  to view this content.

    I wish to do so by referring to the column's name ("Student") instead of other means like devising offset or any other way. I have been monkeying with left([Student],3) and left(tblTable[student],3) and left([@student],3) and left(tblTable[@student],3) (Obviously not having a clue as to what the "@" sign is for...) but I suspect most monkeys would have better luck than I did.

    The easy part for me is left(blahblah, 3).

    The hard part for me is just what is blahblah!

    Can anyone help?

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Refer to a cell in another column within a table

    Left(Cell.value,3)
    Elegant Simplicity............. Not Always

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Refer to a cell in another column within a table

    I'm guessing something like:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  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
    583

    Re: Refer to a cell in another column within a table

    Thank-you both, very much for trying to help me!

    The situation is along the lines that TMS offered, but I get a Run-time error of 1004 even when I broke it down to the most simple form, worksheet attached hereto-
    1004.JPG

    Why is this so elusive???
    Attached Files Attached Files

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Refer to a cell in another column within a table

    Does this help:

    Please Login or Register  to view this content.

    Regards, TMS

  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
    583

    Re: Refer to a cell in another column within a table

    Thanks TMS; I really hoped there was a solution referring to a relative cell within a specific column I could stipulate, but if someone with your qualifications breaks back down to a strict offset solution, it is time to give up on a named column direction. I will just have to add in a variable and a find routine, as the incoming data on the sheet I import has the column with their names "move around"; I can not depend on it being in the same place but I can depend on it being named the same.

    Thank-you.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Refer to a cell in another column within a table

    OK, try one of these. The second is probably more like the thing you are looking for:

    Please Login or Register  to view this content.

    Note you need to adjust cell.row by the number of blank rows and the header.

    Regards, TMS
    Last edited by TMS; 03-09-2014 at 05:09 PM.

  8. #8
    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
    583

    Re: Refer to a cell in another column within a table

    I am going to try it out either tomorrow or Tuesday, but for now my head is aching, eyes are crossed and I don't know how some folks do this ALL the time...(!)

    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. Refer to a cell on a previous sheet which can be anywhere in a column
    By Marco-Kun in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2012, 10:38 AM
  2. Replies: 3
    Last Post: 01-20-2012, 01:35 PM
  3. How to create formula index refer on refference table
    By poojiemilan in forum Excel General
    Replies: 1
    Last Post: 12-31-2011, 07:16 AM
  4. code change to refer to column name rather than column position
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2009, 11:04 AM
  5. refer to cell using the value in Row 1 and column A
    By Chip in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2005, 12:05 PM

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