+ Reply to Thread
Results 1 to 4 of 4

Table Header Reference Query

  1. #1
    Registered User
    Join Date
    02-13-2020
    Location
    hull, england
    MS-Off Ver
    2007
    Posts
    32

    Table Header Reference Query

    Hi,

    Am doing a works project and have the code to search a column for a string and retrieve the information in the cells of that row into textboxes on a userform.
    Right now its referencing the column number. and this works fine.
    Am not savvy enough to be able to reference it the column header instead of the row number. Have tried a couple of ways off Google but with no joy.
    I could do with this as I have the single userform for multiple tables on multiple sheets where the columns can differ.
    Would someone be able to help me out.
    The code am currently using (for the column number) is below. As an example to get me started the first table name is "kiln1tbl" and one header is "material".
    Thanks in advance

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    05-09-2021
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    148

    Re: Table Header Reference Query

    Hello El-Paso,

    Well you could easily use the same method as for the rows by.

    1. define the last column
    2. Loop through each column until you get one, Switch the variable place to
    Please Login or Register  to view this content.
    Tho other way would be to use Objects, so something like
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-13-2020
    Location
    hull, england
    MS-Off Ver
    2007
    Posts
    32

    Re: Table Header Reference Query

    Hi MrChulo

    Thanks for taking the time to reply.
    Am not sure how to set the header text needed on the first example.
    The second example works but the problem is setting the srchheader as I have up to 30 columns so it would need an easy way of working it out.
    An example I have on another command is

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    but Iv tried fitting this into my new code and it doesn't like it.

  4. #4
    Forum Contributor
    Join Date
    05-09-2021
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    148

    Re: Table Header Reference Query

    Hi,

    I am not sure I understand. I thought you wanted to look for a specific column, that is, that the column was known for you, I assumed from the userform.

    Maybe provide an example of your excel file and show how it works and with a set of inputs, what is the expected outcome...

+ 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] How to reference table column header name and table row number?
    By riskywhat in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-26-2019, 01:01 PM
  2. Changing Column Header for Query Table
    By jp16 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-22-2019, 11:47 PM
  3. Dynamic reference to Table Column header
    By aiyathomas in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-08-2017, 10:30 PM
  4. Query table no header with autofilter on
    By vilegor in forum Excel General
    Replies: 0
    Last Post: 03-20-2015, 02:45 PM
  5. [SOLVED] Can a query reference another query or table?
    By jgomez in forum Access Tables & Databases
    Replies: 2
    Last Post: 06-07-2013, 09:57 AM
  6. [SOLVED] Create Dynamic Column Lookup Reference based on Table Header
    By jeversf in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-22-2013, 12:49 PM
  7. Form Textbox - Reference Different Table/Query
    By NSTurk725 in forum Access Tables & Databases
    Replies: 2
    Last Post: 09-08-2009, 04:37 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