+ Reply to Thread
Results 1 to 4 of 4

Code to save data

  1. #1
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    174

    Post Code to save data

    Hi Guys,

    Maybe this is easy for you but not for me.
    I have two userform:
    - UserForm1 (for entry data): contain textbox1 (as entry text) and commandbutton1 (as Save button)
    - Userform2 (as records only): contain label1
    Below this code under Userform1
    Please Login or Register  to view this content.
    If data entry on textbox1 (Userform1), then will be saved on label1 (Userform2) after commandbutton1 (as Save) pressed. Also the textbox1 will be reset/clear after commandbutton1 clicked.
    I don't know how to create code to save the data on UserForm2.
    If anyone of you Guys, can helps me, I am really appreciate.

    Best Regards,
    Iqbal

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,866

    Re: Code to save data

    First, just to be clear, if the user enters data into UserForm1.TextBox1, it will immediately cause an update to UserForm2.Label1. It does not wait for the user to press Save.

    If you want UserForm2.Label1 to continue to have the same value, even after clicking Save, then you need to suppress an update to the label when you are clearing the text box. Use code like this (untested, but I would be happy to test it if you provide your file):

    Code in UserForm1:
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: Code to save data

    Hi Jeff,

    Yes, your code exactly like my expectation.
    And, I add more one button "Exit" as commandbutton2. This button to save in a file which is opening now.
    The aim is after fill up on the "textbox1", then press save. It will save on the userform2 itself.
    And if "Exit" (commandbutton2), then the character what ever it wrote, will be saved in the file itself.
    This file, i would like to send to other people and if he re-send back to me, what ever he wrote, it will be back to me as he was input.
    I attached the file for your reference.
    Thank you so much Sir and appreciated.

    Best Regards,
    Iqbal
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: Code to save data

    Hi Jeff,
    I've been modified and i found the simple code how to save the workbook.
    Look like i have to print on Worksheet also, then i can save the data entry.
    I use this code to save the data:
    Please Login or Register  to view this content.
    Thank you so much Sir, I will add reputation for you.

    Best Regards,
    iqbal

+ 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] VBA code to save current worksheet as temporary PDF file and then add to my existing code
    By brianfromla in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-20-2014, 08:35 AM
  2. Replies: 4
    Last Post: 02-03-2014, 05:33 PM
  3. Need a VBA Code to refresh data and save the active sheet as a new workbook.
    By Mysore in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2012, 08:50 AM
  4. Code, that disables save, save as and close commands
    By mgmetev in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2009, 06:31 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