+ Reply to Thread
Results 1 to 7 of 7

Macro that exports data from form to folder

  1. #1
    Registered User
    Join Date
    07-07-2008
    Location
    NY
    Posts
    4

    Macro that exports data from form to folder

    Hi, I'm a newb when it comes to trying to with VB in excel, but I appreciate any help.

    What I'm trying to do is create a macro that records certain information from a form in excel that I've already made. I want to export the specific information to a public folder for the purpose of filing/saving data.

    I'm planning on creating a button on the sheet that I press, and then certain information would be saved and backed up in the other folder each time new data is entered into the form and you press the "save to "x" drive" button or whatever.

    I've been reading up on it all, and have some ideas of what I need, but I'm not sure exactly what question I need to ask, and what information I need. Really what I'm asking is for someone to point me in the right direction... Please let me know what other information I need to provide for you to provide more accurate help

    Thanks for any help in advance!
    Last edited by VBA Noob; 07-07-2008 at 01:36 PM.

  2. #2
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    Form? Is this a userform? Or is your data in worksheet cells? Would your backed up data be restored to the exact same structure as it was saved from? Will you utilizing this data for anything other than restoring it to the same cells it originated from?

    Thanks, Tom

  3. #3
    Registered User
    Join Date
    07-07-2008
    Location
    NY
    Posts
    4
    *I attached a general example to give a clearer picture

    Sorry, that was vague: when I said form I meant worksheet cells that have data entered in manually according to a label I have on a column. I do not intend to copy it exactly, but instead pull the values from certain cells and columns, and save the data in a different arrangement.

    I attched a general example of the format I'm using. I want to save a few of the fields to a folder: (from the example) So I would save by date and include Location, Event, and the Label Types for example. It could work by just saving those items to a new worksheet I think.

    I want the certain items that I save from this worksheet to appear in a common folder where each time someone presses the shortcut button (or run the macro) the list in the common folder is updated.

    Again, I know open ended questions aren't appreciated, but I'm unsure of the steps I need to take and I appreciate all the help I can get.

    Thanks again!
    Attached Files Attached Files
    Last edited by m094578; 07-08-2008 at 02:18 PM.

  4. #4
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    "I want to save a few of the fields to a folder: (from the example) So I would save by date and include Location, Event, and the Label Types for example. It could work by just saving those items to a new worksheet I think."

    My answer to you would depend on "what" you will be doing with your backup data. Now that your data is backed up somewhere. What now? How will you use it. What level of access or flexibility do you need for working with your data?

    For example, the field in A2, Location, might contains a dropdown list of all locations and load a "backup" into your form after a selection has been made. If there are multiple records for the same location, you might need to select a date and/or event to narrow down your returns. I do not have a clue.

    If you simply need a list of these field and have no intentions of using the data except for manually viewing it, please say so..

  5. #5
    Registered User
    Join Date
    07-07-2008
    Location
    NY
    Posts
    4
    I see what your saying. Currently I go through the process of copying data from this form to another folder manually on a regular basis, and I want to "automate" the process. Additionally, if all the data was saved consecutively, in one worksheet, I could perform a trend analysis on it, whereas currently I can't because each form is saved seperately, and the data isn't arranged in a way that I could perform a trend analysis.

    Thanks for the responses.

  6. #6
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    Ok. So you simply want to transpose your form into a single record. It might be as simple as:

    Please Login or Register  to view this content.
    This would append your form data to a csv file or create the csv file if it does not exist. This is the simplest example that only takes into account a file being locked by another application. As is, it allows for duplicate entries. Is this a problem? You can arrange the print operation as you wish. The example above, using your attached example, is saving the location, date, and time.

    Is the path you are saving to a local or network folder? Will multiple users be updating this file at the same time from different workbooks?

  7. #7
    Registered User
    Join Date
    07-07-2008
    Location
    NY
    Posts
    4
    Thanks for the help Tom,

    I would be recording the macro to a Network folder, and that is a problem I ran into. Otherwise, I guess I could just record a macro, open the designated workbook, copy and paste the individual cells and add a loop so it doesn't copy over the old information.

    Additionally, there would be more than one person using this at the same time, so I wasn't sure if that would be a problem.

    I apologize, but I don't understand the code in your post; I tried to run it, but I'm not sure what I'm looking at. Also, security isn't a concern.

    The only code I have so far is from what I record, and I don't know where to add the loop.

    Thanks again for all help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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