VBA to create .txt files based on the filter criteria

rakesh99932

New member
Joined
Feb 25, 2020
Messages
2
Reaction score
0
Points
0
Excel Version(s)
2016
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.
 

Attachments

  • Primary.xlsm
    36.5 KB · Views: 7
  • Template.xlsm
    35 KB · Views: 12
  • 212_dx_042220.txt
    1.3 KB · Views: 11
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
 
Sure. Kindly deactivate or delete this post. Sorry.
 
Back
Top