+ Reply to Thread
Results 1 to 5 of 5

Populate Multi Column ListView Control with Text File (.txt)

  1. #1
    Forum Contributor
    Join Date
    09-18-2014
    Location
    Pakistan
    MS-Off Ver
    2013, 2016
    Posts
    283

    Question Populate Multi Column ListView Control with Text File (.txt)

    Dear Experts!

    Hope you are doing best in your life.

    I have a listview control with 6 columns and have a Text file with 6 columns (All columns separated with vbTab)

    I want to import it into a ListView control.

    Please guide me accordingly

    I shall be very thankful to you.
    Last edited by AmirSoft; 07-07-2018 at 11:55 AM.
    Don't wait for the PERFECT MOMENT
    take the moment and make it PERFECT
    Amir

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Populate Multi Column ListView Control with Text File (.txt)

    Hello AmirSoft,

    This macro lets the user select a file to open. The macro is set to view 6 columns of tab delimited data in the file. The name of the ListView control is "ListView1". Yo may need to change this if your control has a different name. Copy and paste this macro to a VBA Module in your workbook's project.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    09-18-2014
    Location
    Pakistan
    MS-Off Ver
    2013, 2016
    Posts
    283

    Re: Populate Multi Column ListView Control with Text File (.txt)

    Thank you so much for your reply

    I made an example file. Please check this and guide me.
    in this file a userform have two listview controls. From List one save the data to txt file
    and load list two from that txt file in report view.

    Shall be very thankful to you.

    Amir
    Attached Files Attached Files
    Last edited by AmirSoft; 07-08-2018 at 11:54 PM.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Populate Multi Column ListView Control with Text File (.txt)

    Hello AmirSoft,

    The attached workbook has 2 new macros: ImportTextFile and ExportTextFile. The text file is named "Stock Balance.txt" and is saved in the same directory as the workbook. These macros are called by Command Buttons 5 and 6, respectively. Here is the code...

    Module1 Macros
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Leith Ross; 07-10-2018 at 11:25 AM.

  5. #5
    Forum Contributor
    Join Date
    09-18-2014
    Location
    Pakistan
    MS-Off Ver
    2013, 2016
    Posts
    283

    Re: Populate Multi Column ListView Control with Text File (.txt)

    Dear Leith Ross!

    Thank you so much. You did really a great work.

    I have an other thread. But it is still unsolved.
    https://www.excelforum.com/excel-pro...ml#post4929444

    If you have some time then please take a look on above link. and guide me it is possible or not.
    If this is possible then please guide me.

    I shall be very thankful to you.
    Last edited by AmirSoft; 07-10-2018 at 11:27 PM.

+ 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. export/import excel data to/from text file
    By Axmed.cm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2016, 09:25 AM
  2. [SOLVED] Export specific range to text file and import the text file if needed
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-06-2015, 07:38 AM
  3. [SOLVED] Help with export data to text file.
    By lengwer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-23-2013, 01:54 PM
  4. [SOLVED] text based file import, database populate and then export.
    By R2dical in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-27-2013, 06:12 PM
  5. export data to text file (.txt)
    By jsantos in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-03-2011, 06:12 AM
  6. [SOLVED] How do I import text file, analyze data, export results, open next file
    By Geoffro in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2005, 04:06 PM
  7. Export / Import to / from Text file
    By C_Ascheman in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-22-2005, 08:06 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