+ Reply to Thread
Results 1 to 3 of 3

Is there a way to locate particular colum header names?

  1. #1
    Registered User
    Join Date
    11-12-2018
    Location
    New York, USA
    MS-Off Ver
    365
    Posts
    3

    Is there a way to locate particular colum header names?

    Hello Everyone.

    On a daily basis, I work with about 15 different Excel files which need to be summarized and put into a daily dashboard. These files are created by different users / groups within the firm.

    For each file, I create a copy of the data so my group has a copy, and I create a pivot table with the data needed for the dashboard.

    I have created / written macros to do all of this, which I run on one file at a time. On some of these files, I need to add columns and do a series of Vlookups to fill in information I need. All of the macros and lookup tables are kept in a separate macro spreadsheet (but that has no relation to my question).

    The problem I face is that sometimes different people create a particular spreadsheet, and they don't always keep the columns in the same order, and my macros rely on looking at specific columns. So, at best, the pivot tables are filled with #N/A values because columns weren't where they were supposed to be. At worst, the macro stops cold because it was expecting a particular column that's not there.

    Is they any way in VBA to flag the specific columns I need based on the header name, then use that to look where those columns are to lookup the correct data?

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Is there a way to locate particular colum header names?

    Chippe01,

    Welcome to the forum

    You could use variables for those columns, and find the text, then assign that column number to the variable. Then use that variable for your column reference in other parts of the code. Here is a basic example:

    Please Login or Register  to view this content.
    If you use the myCol variable again to find the next relevant column, don't forget to "Set myCol = Nothing" after each use.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    11-12-2018
    Location
    New York, USA
    MS-Off Ver
    365
    Posts
    3

    Re: Is there a way to locate particular colum header names?

    Thank you, I will give this a try when I return to work. I'll let you know how it turns out.

+ 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. Possible? Macro that will search and locate a colum of info
    By sdehod in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-17-2013, 01:38 PM
  2. Locate max value of one column based on criteria in another colum
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 09:05 PM
  3. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  4. [SOLVED] Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  5. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  6. Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  7. [SOLVED] Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 AM
  8. [SOLVED] Locate max value of one column based on criteria in another colum
    By JDay01 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM

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