+ Reply to Thread
Results 1 to 6 of 6

Help needed with Userform - create text file with data from userfrom

  1. #1
    Registered User
    Join Date
    04-03-2016
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    39

    Help needed with Userform - create text file with data from userfrom

    Attached the userform I have created. Need to create a textfile with data from userform.

    1. Filename is taken from first textbox
    2. Path: "D/Folder"
    3. Clear button - Searches the file specified in first textbox and clears the existing content (Path: D:/Folder)
    4. Add button adds the text from second textbox to file and keep an clicking add should append the text to the next line.
    5. Submit button should save the textfile and close the form.
    6. If Possible add a Cancel button with code " unload Me"

    Sample output of textfile

    123456
    ASDFGH
    666704

    Kindly help me with the code,

    Thanks,
    Balaji N
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: Help needed with Userform - create text file with data from userfrom

    Try this file. Run macro 'Test'
    Attached Files Attached Files
    Last edited by abduljaleel.mca; 07-27-2016 at 11:12 AM. Reason: Changes the path of the file to "D:\Folder\"

  3. #3
    Registered User
    Join Date
    04-03-2016
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    39

    Re: Help needed with Userform - create text file with data from userfrom

    Quote Originally Posted by abduljaleel.mca View Post
    Try this file. Run macro 'Test'
    Did you tested it by yourself. It goes not responding when i click "ADD"

    Thanks,
    Balaji N

  4. #4
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: Help needed with Userform - create text file with data from userfrom

    It works for me. Make sure on the following points,
    If your file name 'Test' then enter in first text box 'Test', you should not enter as 'Test.txt'.
    Once 'add' or 'clear' is done, click submit button to see the updates in text file and to close the user form. You must click the Submit button to see the progress.
    Last edited by abduljaleel.mca; 07-27-2016 at 11:12 PM.

  5. #5
    Registered User
    Join Date
    04-03-2016
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    39

    Re: Help needed with Userform - create text file with data from userfrom

    Quote Originally Posted by abduljaleel.mca View Post
    It works for me. Make sure on the following points,
    If your file name 'Test' then enter in first text box 'Test', you should not enter as 'Test.txt'.
    Once 'add' or 'clear' is done, click submit button to see the updates in text file and to close the user form. You must click the Submit button to see the progress.
    It actually works, but the text files should be already present in the specified path. Could you please help me with below modifications?

    Attached modified userforms,

    1. Set Path button from Omni_Data_Miner should create folder mentioned in Path_Field if it does not exist and create 26 text files named in AC15:AC40 in sheet1. If already files exists clears their content.
    2. Set FileName text from in Plan_Details form the values from AB2 to AB13 when Record_Selection combobox from Omni_Data_Miner sheet value is selected.
    This combobox takes input from AA2 to AB13. When BT Record is selected, that is AA2 is selected then the desired file name is "BT.GEN.DES.PLANS".txt. This value from AB2 should be autopopulated in Plan_Details userform.

    The aim is to generate 12 different text files from Plan_Details userform based on the 12 options chosen from Omni_Data_Minor form.

    Kindly help me.

    Thanks,
    Balaji N
    Attached Files Attached Files
    Last edited by balajinatarajan; 07-30-2016 at 07:27 PM. Reason: Typo and Wrong Attachment.

  6. #6
    Registered User
    Join Date
    04-03-2016
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    39

    Re: Help needed with Userform - create text file with data from userfrom

    Quote Originally Posted by balajinatarajan View Post
    It actually works, but the text files should be already present in the specified path. Could you please help me with below modifications?

    Attached modified userforms,

    1. Set Path button from Omni_Data_Miner should create folder mentioned in Path_Field if it does not exist and create 26 text files named in AC15:AC40 in sheet1. If already files exists clears their content.
    2. Set FileName text from in Plan_Details form the values from AB2 to AB13 when Record_Selection combobox from Omni_Data_Miner sheet value is selected.
    This combobox takes input from AA2 to AB13. When BT Record is selected, that is AA2 is selected then the desired file name is "BT.GEN.DES.PLANS".txt. This value from AB2 should be autopopulated in Plan_Details userform.

    The aim is to generate 12 different text files from Plan_Details userform based on the 12 options chosen from Omni_Data_Minor form.

    Kindly help me.

    Thanks,
    Balaji N
    I was able to update as required with the help of Google. Closing this thread.

    Thanks,
    Balaji N

+ 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. [SOLVED] Create text file based off of common text in column A with data in columns B-F
    By BG1983 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2016, 12:47 PM
  2. [SOLVED] Load data from text file - needed fileds in VB
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2016, 02:45 PM
  3. VB to use data from spreadsheet and input box to create new folder and text file
    By cmccabe in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-19-2015, 05:40 PM
  4. [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
  5. Create A Text File Generator from Userform
    By irsan anwar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-07-2015, 07:31 PM
  6. [SOLVED] Filter and Export Data to CSV Text File With Userform Command Button
    By omagoodness in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2015, 11:18 AM
  7. VBA Help needed to create a document based on user input thru UserForm
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-15-2013, 02:45 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