VBA ComboBox

shiftygearbox

New Member
Joined
Nov 5, 2016
Messages
1
Hello, I am trying to create a Sign In/ Out log for work. So far I have the first half complete, where i can able to record all pertinent data name, trailer number, route, date and time in, but this is a two step process. now I have to figure out how I am going to input the "time Out". What i was thinking i could do is use a combobox to display all the rows with no "Time Out" value, but i just do not know where to start. Below is the code for the sign in portion. Please help!


Private Sub cboRoute_DropButt*******()
'Populate Control.
Me.cboRoute.AddItem "Ryder"
Me.cboRoute.AddItem "Rocker"
Me.cboRoute.AddItem "TransNav"
Me.cboRoute.AddItem "Service"
Me.cboRoute.AddItem "Norplas"
Me.cboRoute.AddItem "Other"
End Sub


Private Sub cmdSaveEntry_Click()
'Copy input values to sheet.
MsgBox "Your Time In has been Recorded, please do not forget to sign out."
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("SignInSheet")
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(lRow, 1).Value = Me.txtFirst.Value
.Cells(lRow, 2).Value = Me.txtLast.Value
.Cells(lRow, 3).Value = Me.txtTrailerNumber.Value
.Cells(lRow, 4).Value = Me.cboRoute.Value
.Cells(lRow, 5).Value = Format(Now, "mm/dd/yy/ hh:mm")
End With
'Clear input controls.
Me.txtFirst.Value = ""
Me.txtLast.Value = ""
Me.txtTrailerNumber.Value = ""
Me.cboRoute.Value = ""
Unload signin
End Sub
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,214,932
Messages
6,122,323
Members
449,077
Latest member
jmsotelo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top