+ Reply to Thread
Results 1 to 8 of 8

Saving Textbox value to a notepad (VBA)

  1. #1
    Registered User
    Join Date
    03-11-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    17

    Saving Textbox value to a notepad (VBA)

    Hi All, is there a way to save the value of the textbox to a notepad when I click the "Save" button?Textbox.PNG

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Saving Textbox value to a notepad (VBA)

    Please Login or Register  to view this content.
    textbox1 being your textbox
    replace File location and file name with where you want it and what you want it called
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    03-11-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Saving Textbox value to a notepad (VBA)

    Hi Sir/Maam it works but i need to save it daily. For example all data i save on the textbox1 will be saved to the notepad as "July 9.txt", tomorrow it will be save as "July 10.txt", and so on or simply it will be saved as what date is the file created... Appreciate your assistance
    Last edited by nathan0519; 07-09-2014 at 04:01 AM.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Saving Textbox value to a notepad (VBA)

    you need to define what your asking better than
    you only asked for saving textbox into text

    have another variable string and use that to set your filename

  5. #5
    Registered User
    Join Date
    03-11-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Saving Textbox value to a notepad (VBA)

    Something like this Sir/Ma'am,
    Directory = "D:\File\"
    Date = Now
    Filename = "D:\File\July 10.txt"


    ---so when I use it here, the "Filename" will hold a value of "D:\File\July 10.txt"
    Set FN = fs.CreateTextFile(Filename, True)

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Saving Textbox value to a notepad (VBA)

    Please Login or Register  to view this content.
    this code takes value from A1
    remember that naming conventions apply
    characters \ / : * ? " < > | cannot be used

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Saving Textbox value to a notepad (VBA)

    Please Login or Register  to view this content.
    this code will use todays date in MMM-YY format
    ps this code will overwrite previous files so if you run it twice it will take the latest version


    change drive to your needs, i used G because for my testing
    Last edited by humdingaling; 07-09-2014 at 08:21 PM.

  8. #8
    Registered User
    Join Date
    03-11-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Saving Textbox value to a notepad (VBA)

    Thank you very much humdingaling. It's ok now

+ 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. Copy-Pasting values into Notepad, then saving it
    By aijp in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-19-2013, 02:55 PM
  2. Textbox to notepad
    By mr_mead in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-22-2013, 07:39 AM
  3. how to copy selected notepad text and paste it in other notepad with macro
    By Guru232 in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 04-24-2013, 04:43 AM
  4. Saving workbook as notepad using cell data for filename & retaining original workbook name
    By peterkerr_13 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-26-2012, 08:07 AM
  5. Saving Notepad from VBA
    By ricardodickstein in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-06-2009, 11:18 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