+ Reply to Thread
Results 1 to 4 of 4

Data Input Form

Hybrid View

  1. #1
    Registered User
    Join Date
    11-23-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    21

    Data Input Form

    Hey guys

    I’m looking for a macro or VBA code to take data from my input screen to my data table. What I am aiming for is the data input screen to just take the few bits of info I need for each record and then when completed and hit enter it moves to the data table and leaves me with a blank input section once again.

    Any help greatly appreciated. Workbook attached

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Data Input Form

    Are you saying you want all lines entered in "Input Screen" to go to new lines in the "Data Table", and then blank the sheet "Input Screen"?
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Data Input Form

    This code will do what I described, but.... you have a worksheet change event going on on the Input Screen, so when A2 changes, it tries to do stuff with "Sheet3" which does not exist, so you will have to modify that to work.
    Sub data_move()
    
    Dim ws_src As Worksheet 'the sheet with the source data
    Dim ws_dest As Worksheet 'the sheet where the data is going
    Dim lr_src As Long 'last row with data in source
    Dim lr_dest As Long 'last row with data in destination
    Dim i As Long 'loop variable
    
    Set ws_src = Worksheets("Input Screen")
    Set ws_dest = Worksheets("Data Table")
    lr_src = ws_src.Range("A" & Rows.Count).End(xlUp).Row
    lr_dest = ws_dest.Range("A" & Rows.Count).End(xlUp).Row + 1 'adding 1 to last row to make it the first blank line
    For i = 2 To lr_src
        ws_dest.Range("A" & lr_dest).Value = ws_src.Range("A" & i).Value
        ws_dest.Range("C" & lr_dest).Value = ws_src.Range("B" & i).Value
        ws_dest.Range("D" & lr_dest).Value = ws_src.Range("C" & i).Value
        lr_dest = lr_dest + 1
    Next i
    ws_src.Range("A2:A" & lr_src).ClearContents
    
    End Sub

  4. #4
    Registered User
    Join Date
    11-23-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Data Input Form

    Maybe it would be better if I had an input form?

+ 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. Data Input Form with number of line items based on user input
    By j_gideon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2013, 02:54 PM
  2. Looping a data input form based on form option
    By bologne in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-17-2011, 03:06 AM
  3. Excel 2007 : data input form
    By kitto in forum Excel General
    Replies: 7
    Last Post: 08-02-2010, 01:31 PM
  4. Excel 2007 : Data Input Form
    By Cushionsupplier in forum Excel General
    Replies: 2
    Last Post: 03-18-2010, 02:09 AM
  5. [SOLVED] Data input form
    By Barney in forum Excel General
    Replies: 8
    Last Post: 01-08-2006, 05:15 AM

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