+ Reply to Thread
Results 1 to 2 of 2

Enter information from previous cell when information is inserted

  1. #1
    Registered User
    Join Date
    10-08-2015
    Location
    CT,United States
    MS-Off Ver
    2010
    Posts
    1

    Enter information from previous cell when information is inserted

    The code below will paste the information from the userforms text box and into a "Database". Information will be populate Ranges A1:N1 on the "Database" Sheet; if pressed again will populate the next empty row. There is a time stamp code on "Database" Sheet, will insert a time stamp on last two cells of the line Ex: Date (M1) and Time (N1). Currently users have to fill the time from N1 into cell C2 and so on. I want to take the Time from (N1) and when users press insert for Ranges A2:N2 (the next empty line) insert the time from cell N1 into C2 and so on. I tried =Now circular but does not work. I was thinking of a code that would The previous time stamp when populated.

    Insert Button
    Private Sub Completecmd_Click()

    Dim sht As Worksheet, outsht As Worksheet, r As Long
    Set outsht = Sheets("Database")

    With ws
    Set sht = Sheet11
    r = outsht.UsedRange.Rows.Count
    outsht.Cells(r + 1, 1) = sht.Range("B2") 'Operator
    outsht.Cells(r + 1, 2) = sht.Range("A4") 'Sales Order
    outsht.Cells(r + 1, 3) = sht.Range("B4") 'Start Time
    outsht.Cells(r + 1, 4) = sht.Range("C4") 'End Time
    outsht.Cells(r + 1, 5) = sht.Range("D4") 'Item
    outsht.Cells(r + 1, 6) = sht.Range("E4") 'JobQTY
    outsht.Cells(r + 1, 7) = sht.Range("F4") 'Hits
    outsht.Cells(r + 1, 8) = sht.Range("G4") 'Additional Hits
    outsht.Cells(r + 1, 9) = sht.Range("H4") 'Total Hits
    outsht.Cells(r + 1, 10) = sht.Range("I4") '#set ups
    outsht.Cells(r + 1, 11) = sht.Range("J4") 'Scraps
    outsht.Cells(r + 1, 12) = sht.Range("B6") 'Comments

    End With
    Me.SOTextBox.Value = ""
    Me.TextBox2.Value = ""
    Me.TextBox3.Value = ""
    Me.TextBox4.Value = ""
    Me.SOTextBox.Value = SetFocus

    End Sub

    Thanks in Advance
    Last edited by freyn1; 12-01-2015 at 01:14 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Enter information from previous cell when information is inserted

    If I understood the description:
    instead of
    Please Login or Register  to view this content.
    write
    Please Login or Register  to view this content.
    Please note how code tags improve readability and edit your post using it - as required by our http://www.excelforum.com/forum-rule...rum-rules.html
    Best Regards,

    Kaper

+ 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. [SOLVED] Enter information on one sheet based on the information in another sheet in the same wkbk
    By slindfors in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-19-2015, 03:16 PM
  2. Replies: 4
    Last Post: 06-26-2015, 02:43 AM
  3. Enter information if previous is fillied
    By kuzna26 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-13-2013, 05:33 PM
  4. Replies: 4
    Last Post: 06-11-2013, 09:50 AM
  5. Auto Populate Cells Dependent on Information in Previous Cell
    By senescu in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 07-21-2010, 11:50 AM
  6. Replies: 2
    Last Post: 07-21-2010, 09:10 AM
  7. How do I make someone enter information in a cell
    By Vicky T in forum Excel General
    Replies: 1
    Last Post: 06-07-2006, 12:50 PM

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