+ Reply to Thread
Results 1 to 2 of 2

Macro for Submit/Print that will copy data from form into a history log and reset form

  1. #1
    Registered User
    Join Date
    02-28-2013
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    7

    Exclamation Macro for Submit/Print that will copy data from form into a history log and reset form

    Hello. I am well versed with excel, but new to VBA/Macros. My situation seems to be unique, but aren't they all? Please don't link me to another 'how-to' site or someone's blog/video. I have been researching various forms and Excel tutorial websites for a few days now and have come across a few bits and pieces of what I am looking for, but have been unsuccessful in attempts to paste it all together. I am running short on time to get the project complete and am hoping that someone out there can help!

    I have a worksheet (Estimate Input) that is basically a form - there are several cells that the user would input data into. I have a second worksheet (Estimate Log) which I want to house each individual form entry in a new line. I am looking for a macro/code that will automate this process when the user clicks on a [Submit] button; at the same time the button is clicked, I want the macro/code to save a copy of that worksheet 'as-is' in a new workbook and save it in a specified folder using the data in a specific cell to name it then to clear the form data. Furthermore, I want a macro/code that will automatically print this worksheet when the user clicks on a [Print] button.

    I have several projects going on right now that I could use this same process with once I saw an example and could better understand how it works. I have been successful in setting up the process in reverse (taking data from a database and populating a form using Vlookups and Pivot tables) but that is not what I need in this case. I thank you profusely in advance for any help that is given. I have additional possibly relevant information below.

    Cells in worksheet [Estimate Input] to be copied to worksheet [Estimate Log] in order that they would be copied:
    I2,B8,B9,B10,B11,E7,J40,A15,B15,A16,B16,A17,B17,A18,B18,A19,B19,A20,B20,A21,B21,A22,B22,A23,B23,A24,B24,A25,B25,A26,B26,A27,B27,A28,B28,A29,B29,A30,B30,A31,B31,A32,B32,A33,B33,A34,B34,A35,B35,A36,B36,A37,B37,A38,B38,A39,B39

    In Worksheet [Estimate Log], the first cell to have the copied data would be B6. (Column A is set to autogenerate when data is entered into Column B). I want each new submission to save in [Estimate Log] as a new row.

    Some of the cells being copied from [Estimate Input] to [Estimate Log] are formulas in nature; however I only want the values to copy over, not the formulas.

    Thanks again!
    Britt

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro for Submit/Print that will copy data from form into a history log and reset form

    This should get you there, or most of the way:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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