Hi everyone. I am new to this forum so hopefully have got this post correct!
I have created a spread sheet that imports a CSV file of data and then I create a number of summary reports from this raw data in other workbook sheets.
The trouble I have is that the Vlookup and Hlookup functions seem to need a fixed column or row identifier to return a given value. This means the CSV file has to be set-up very precisely with the different columns downloaded from the master database in the same order every time. Unfortunately as I expand this tool and add new data to the CSV file, the order of columns changes and I need to rebuild the whole worksheet.
Is there a way to use a column heading instead of column number to complete the lookup function. For example lookup cell containing "Mark" from the column heading "Names" and return the result from the column heading "Age". At the moment I can only lookup "Mark" in column 1 and return the value from column 3.
Similarly I have recorded a macro to sort data automatically, but the macro also only picks columns by number. For example
Selection.AutoFilter Field:=5, Criteria1:="<>"
Is there a way that field 5 can be identified by the data title rather than position in the spread sheet? Ie it does not matter if the "Age" column is the 5th or 4th in the CSV file.
Thanks for your help with this...
Bookmarks