+ Reply to Thread
Results 1 to 12 of 12

Information on auto saving data using Macro

  1. #1
    Registered User
    Join Date
    07-22-2014
    Location
    Thailand
    MS-Off Ver
    2007
    Posts
    6

    Information on auto saving data using Macro

    Hi Friends,
    Sorry I am new to excel VBA, I tried to search the forum for similar topic but couldn't find it. I have a simple objective. I need to scan 3 serial numbers with a barcode scanner in excel and as soon as I scan the 3rd serial number Excel should autosave those 3 serial numbers in a row with date and time stamp. And when scanned the next 3 serial numbers, excel should do the same in the next row.
    Can this objective be achieved with just Macro in Excel or should I take some help on creating a separate application for this? If it can be achieved with Macro, could any one help on how do I go about this?

    Sorry if the question is vague to stupid, I don't know how else to ask, I am not a big time programmer, just can do the basic small stuff and have just started learning excel VBA. Any help on this would be appreciated.

    Thanks

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Information on auto saving data using Macro

    ...Excel should autosave those 3 serial numbers...
    What does this mean? To the sheet? To a new file? All on the same row? On different rows?
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    07-22-2014
    Location
    Thailand
    MS-Off Ver
    2007
    Posts
    6

    Re: Information on auto saving data using Macro

    Hi,
    Thanks for the reply. Saving on a Different File would be best, but if it is to be saved to any of the options that you provided, they are fine too. All I want is the Data to be Saved, doesn't matter where and the data shouldn't get lost incase the computer gets restarted unexpectedly or crashed.
    All the 3 values along with the Date and Time stamp should be in the same row.

    Thanks
    Last edited by thinklogic; 07-23-2014 at 12:11 PM.

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Information on auto saving data using Macro

    See if this is what you're looking for.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-22-2014
    Location
    Thailand
    MS-Off Ver
    2007
    Posts
    6

    Re: Information on auto saving data using Macro

    Hey Tinbendr,
    Thanks a bunch!!!! That is so close to what I am looking for, I just needed to do minor tweakings like just add a clear button to clear the barcodes , not allow to save in case all the 3 textboxes are not filled.. etc... You have given the theme I need and the Excel Form is working perfectly now. Thanks again!!...
    And I would like to learn how to design this stuff, do you know of any professional video tutorial series that I could watch and learn ?? It's ok if I have to buy the series or something.

    Regards.

  6. #6
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Information on auto saving data using Macro

    I do not know of any published series. Youtube has quite a few. Ozgrid.com has a few.

  7. #7
    Registered User
    Join Date
    07-22-2014
    Location
    Thailand
    MS-Off Ver
    2007
    Posts
    6

    Re: Information on auto saving data using Macro

    Quote Originally Posted by Tinbendr View Post
    See if this is what you're looking for.
    Hey Tinbendr,
    Need help with one small change, You have placed the "New" button on the excel, can the same objective be achieved right after a serial number is entered in TextBox3 and we press "Return" key? without having to click on the button?

  8. #8
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Information on auto saving data using Macro

    Sorry, I don't understand.

  9. #9
    Registered User
    Join Date
    07-22-2014
    Location
    Thailand
    MS-Off Ver
    2007
    Posts
    6

    Re: Information on auto saving data using Macro

    Sorry, I explained it incorrectly. Actually whenever I try to run the code I get the error cannot save file. Can you check this please?
    FormFail.png

  10. #10
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Information on auto saving data using Macro

    I forgot to add the mypath to pull it from the D1.

    Here's a updated version.

    New is probably a misnomer. It should be Clear. It's to clear all the textboxes and start over. But due to the way VBA works, you can't cancel the save if all three bar codes are input. I can change it to where you have to press a command button to save it, if that's a problem. If you Tab out of hte last textbox, it will save it also.

    My barcode scanner adds a Enter to all scans. You may be able to set yours up the same way.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    07-22-2014
    Location
    Thailand
    MS-Off Ver
    2007
    Posts
    6

    Re: Information on auto saving data using Macro

    Thank you for the update, My barcode scanner also does the same and it saves the data as soon as I scan the 3rd Barcode in the textbox. Thanks a bunch Tinbendr, you rock!!!

    Edit: I need one more small change , I see that everytime we open the excel file we need to enable the macros. I changed it to allow all macros in my pc.... but I need to use this on one of my PC's at a different location and I need to use it every day. Is there a way to set the MACRO security settings to "Allow All Macros" in the VBA code , after the first run or something??
    Last edited by thinklogic; 07-28-2014 at 12:37 AM.

  12. #12
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Information on auto saving data using Macro

    Is there a way to set the MACRO security settings to "Allow All Macros" in the VBA code
    No. The security is not exposed to the VBA model. Doing so would render the security meaningless. You'll have to change the security settings through the menus.

+ 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. Replies: 6
    Last Post: 06-18-2014, 09:58 AM
  2. Replies: 3
    Last Post: 07-26-2013, 01:39 AM
  3. [SOLVED] Auto Macro the pulls data from on sheet, prints on another sheet, then deletes information
    By wjwelch1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-06-2013, 01:54 PM
  4. Excel Macro Help, Auto Saving
    By Waindude in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2012, 01:01 PM
  5. Auto Saving Via Macro To Specific File?
    By stevesunfold in forum Excel General
    Replies: 4
    Last Post: 04-11-2008, 11:57 AM

Tags for this Thread

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