+ Reply to Thread
Results 1 to 3 of 3

Userform to Intake Production Data and transfer to Excel Spreadsheet

Hybrid View

dnice2point0 Userform to Intake Production... 04-14-2022, 11:11 AM
torachan Re: Userform to Intake... 04-15-2022, 09:20 AM
Logit Re: Userform to Intake... 04-15-2022, 11:21 AM
  1. #1
    Registered User
    Join Date
    04-13-2022
    Location
    The Woodlands, TX
    MS-Off Ver
    Office 365
    Posts
    1

    Userform to Intake Production Data and transfer to Excel Spreadsheet

    Hey guys,

    First Post here, and I'm relatively new to VBA, and I use Excel Forums when I'm stumped, so hopefully I can get some help here.

    I created the Userform Below:

    Userform.png

    Basically What I want is to input all this information, have the Textboxes recognize "hh:mm" Format, and have the labels calculate the difference in time, and then add up those labels to have Total Machine Hours. Once I have that, I can input the cases produced, Click "Complete", and have that information transferred to a Database Starting with Cell "A2" in ws "Sheet1".

    I've been running into walls, and I can't waste too much time on it. Here is the Code I have so far:

    Private Sub UserForm_Initialize()
    ComboBox1.List = Sheets("MVLU").Range("L2:L128").Value


    End Sub

    Private Sub TextBox1_AfterUpdate()
    If IsDate(Me.TextBox1.Text) Then
    Me.TextBox1.Text = Format(Me.TextBox1.Text, "mm/dd/yyyy")
    End If
    End Sub

    Private Sub TextBox2_AfterUpdate()
    If IsDate(t) Then
    Me.TextBox2.Value = Format(Time, "hh:mm")
    End If
    End Sub

    Private Sub TextBox3_AfterUpdate()
    If IsDate(t) Then
    Me.TextBox3.Value = Format(Time, "hh:mm")
    End If
    End Sub

    Private Sub Combobox1_Change()
    Label16.Caption = Application.WorksheetFunction. _
    VLookup(Val(ComboBox1.Text), Worksheets("MVLU").Range("L2:M128"), 2, False)

    End Sub

    Private Sub TextBox3_Change()

    With Me
    Label17 = Val(.TextBox3.Text) - Val(.TextBox2.Text)
    End With
    Label17 = Format(Label17, "hh:mm")


    End Sub


    However, It continues to give me issues. Please help!

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: Userform to Intake Production Data and transfer to Excel Spreadsheet

    see big yellow banner - how to upload your workbook.
    help us to help you - it is far easier to give a solution when seen in total context.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,485

    Re: Userform to Intake Production Data and transfer to Excel Spreadsheet

    Suggest you take a different direction / method :

    Option Explicit
    Private Sub btnCancel_Click()
        Unload Me
    End Sub
    
    Private Sub btnOK_Click()
        Dim ws As Worksheet
        Set ws = ActiveSheet
        Dim newRow As Long
        
        newRow = Application.WorksheetFunction.CountA(ws.Range("A:A")) + 1
        
        'The next two lines can be expanded as many times as needed for all the entry fields in your project
        
        ws.Cells(newRow, 1).Value = Me.txtFirstName.Value
        ws.Cells(newRow, 2).Value = Me.txtSurname.Value
        
    End Sub
    Sub CommandButton1_Click()
        Selection.EntireRow.Delete
    End Sub
    Download workbook : https://www.amazon.com/clouddrive/sh...L2TjhkCAX0yCIQ

+ 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] Transfer Data from excel to userform
    By (T_T) in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-02-2020, 07:52 AM
  2. [SOLVED] Transfer data from userform textbox to spreadsheet
    By markusvirus in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-22-2015, 10:11 AM
  3. [SOLVED] Transfer data from userform to spreadsheet
    By Katie-S in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-19-2015, 09:48 AM
  4. Transfer listbox and textbox data from userform to spreadsheet
    By NellieNoggs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2014, 02:35 PM
  5. [SOLVED] HOW DO I TRANSFER DATA FROM EXCEL SPREADSHEET TO OUTLOOK
    By msmagoo in forum Excel General
    Replies: 1
    Last Post: 01-16-2006, 01:40 PM
  6. Replies: 1
    Last Post: 12-06-2005, 07:00 PM
  7. Transfer 8 Userform Txtbox entries to new Row in spreadsheet using VBA
    By Celtic_Avenger in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2005, 03:45 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