Results 1 to 4 of 4

Thread: VBA to create .txt files based on the filter criteria

  1. #1
    Neophyte rakesh99932's Avatar
    Join Date
    Feb 2020
    Posts
    2
    Articles
    0
    Excel Version
    2016

    VBA to create .txt files based on the filter criteria



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi,
    I am looking for a VBA which helps in converting excel data to .txt files based on the filter criteria.

    Details:
    I have an Excel file "Primary" which has three columns ID, Instance & Number. The Instance Filter criteria has few values that has to be filtered individually.
    Now I have to copy the Instance column Number Column data to "Template". Now the data in the template has to be converted to .txt file using the defined naming convection. The .txt file has to be generated for each value in the instance.

    Note: The values in the Instance column are dynamic.

    An Example to show:
    1. In "Primary" Excel, Filter a value (212) in the Instance column.
    2. Copy the values in ID column and paste in the ID column of "Template" Excel,
    3. Go back to "Primary" Excel, Copy values from Number column and paste in two columns Final DX & Admit Dx of "Template" Excel.
    4. Now the data in the "Template" Excel should be converted or saved as .txt file, as the format in the attached .txt file for reference. (Naming format of .txt i "instance value_dx_ddmmyy").
    5. The above process will have to be looped till all the values in the Instance column are completed. So that the final number of .txt files are equal to number of values on the Instance column.


    Kindly let me know if you need further info to understand.

    Thank you.
    Attached Files Attached Files

  2. #2
    Conjurer alansidman's Avatar
    Join Date
    Oct 2018
    Location
    Steamboat Springs
    Posts
    236
    Articles
    0
    Excel Version
    2019

  3. #3
    Administrator Pecoflyer's Avatar
    Join Date
    Oct 2011
    Location
    Brussels Belgium
    Posts
    1,709
    Articles
    0
    Excel Version
    2010 on Xubuntu
    Hi and welcome
    Please,do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums Hi and welcome
    Please,do not crosspost your question on multiple forums without including links here to the other threads on other forums.



    One link was provided by Alan
    Thank you Ken for this secure forum.

  4. #4
    Neophyte rakesh99932's Avatar
    Join Date
    Feb 2020
    Posts
    2
    Articles
    0
    Excel Version
    2016
    Sure. Kindly deactivate or delete this post. Sorry.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •