+ Reply to Thread
Results 1 to 2 of 2

VBA to save as .txt files by filtering the values

  1. #1
    Registered User
    Join Date
    02-25-2020
    Location
    india
    MS-Off Ver
    2016
    Posts
    6

    VBA to save as .txt files by filtering the values

    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 Atta
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019
    Posts
    17,741

    Re: VBA to save as .txt files by filtering the values

    crossposted: https://www.excelguru.ca/forums/show...ilter-criteria

    Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    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.

    I have added the crosspost reference for you today. Please comply with this and all our rules in the future

+ 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. Named Parameter error (Trying to batch save as xlsx files as xml data files)
    By dzheng.328 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-13-2019, 03:22 PM
  2. Loop thru files and Save based on cell values
    By mikey3580 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2015, 06:47 AM
  3. Replies: 0
    Last Post: 09-09-2014, 05:21 PM
  4. [SOLVED] Batch job. Open a lot of excel files, delete the same values from each, save, then close
    By greendale in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-06-2013, 03:31 PM
  5. Replies: 1
    Last Post: 09-15-2013, 06:51 AM
  6. [SOLVED] How to save values only from linked Excel files?
    By jmadam39 in forum Excel General
    Replies: 3
    Last Post: 11-30-2005, 01:30 PM
  7. Macro to open *.dat files and save as .txt (comma delimited text files)
    By YehWei@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2005, 01:55 AM

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