Copy 2 columns of data from a text file using criteria for listbox


New Member
Jun 21, 2017
Hi all

I have had a try with this and it's beaten me too. i'm trying to display 2 columns from a text file. Row 1 are headings and the environ$"username" will be the column name I wish to use and contains annual leave type data going down. And i would like to display column 1 which will have dates for the year.

I want to populate a listbox with any rows with dates that have an entry under the corresponding column heading as well as the column with the entry (skipping any blanks).

It should hopefully look like this small example:

Col1 Username
02/04/2018 Annual - AM
05/05/2018 Annual - Day
06/05/2018 Annual - AM

I can do it with Access/SQL fairly easily but due to network traffic i've been told i have to go back in time and use text files.

I have different excel files updating text files and my tool reads them but Im hopeful that it will take over the updating but i still need to display them for people.

Can any body provide me with any solutions?

Many thanks in advance - Mike

Forum statistics

Latest member

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...