How can I insert posted data into the database?

Problem with a button to copy inputs into a database

  • Hello and for your time. I am trying to program a button on anworksheet (in Excel 2003) that is designed to work as a data entry form. There are three sheets in the worksheet: a pretty looking page where data is entered by the user (basic info & results), a page where entries on the first page are mirrored into one row (temp database), and a page where I would like the data to be stored (central database). I have tried numerous times to record a macro for the button which copies the line of input data from the temp database and inserts it into the central database. In all my attempts, I have recieved error messages. The latest looked like this: Sub submittake100() ' ' submittake100 Macro ' Macro recorded 7/6/2010 by Adam O'Neill ' ' Sheets("temp database").Select Range("A2:GN2").Select Selection.Copy Sheets("central database").Select ActiveWindow.SmallScroll Down:=-9 Range("A2:GS2").Select Selection.Insert Shift:=xlDown Sheets("Basic info & results").Select End Sub Originally I was trying to cut and insert the data as that would serve the dual function of clearing the fields on the form as well. I am currently in China and have access to neither englishbooks nor most of the tutorials which are on youtube (the great firewall). I have no programming skills, but wouldn't mind learning someVBA. Any help you can offer is very much appreciated. Thank you again.

  • Answer:

    The code itself looks fine, but you haven't told me the error message - a streamlined version of the code which never changes the selection is Sub akk() Sheets("temp database").Range("A2:GS2").Copy Sheets("central database").Range("A2:GS2").Insert Shift:=xlDown End Sub If you can let me know where you are having errors I can try to help further, and if it helps my direct email is [email protected]

Miningco.com Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.