I am not sure if your design for table1 is efficient for extracting the hours, but I leave that up to you. In order to record the hours I have added columns inbetween the name columns
[TABLE="width: 1415"]
<tbody>[TR]
[TD][/TD]
[TD]Table1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Table4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Worker names[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Worker Supervisor[/TD]
[TD]WS hours[/TD]
[TD]Worker1[/TD]
[TD]W1 Hours[/TD]
[TD]Worker2[/TD]
[TD]W2 Hours[/TD]
[TD]Worker3[/TD]
[TD]W3 Hours[/TD]
[TD]Worker4[/TD]
[TD]W4 Hours[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]KEVIN[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]KEVIN[/TD]
[TD]8[/TD]
[TD]NIMA[/TD]
[TD][/TD]
[TD]MATTHEW[/TD]
[TD][/TD]
[TD]GARY[/TD]
[TD][/TD]
[TD]TIMOTHY[/TD]
[TD]4,5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]NIMA[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]NIMA[/TD]
[TD][/TD]
[TD]MATTHEW[/TD]
[TD][/TD]
[TD]GARY[/TD]
[TD]4[/TD]
[TD]TIMOTHY[/TD]
[TD]2[/TD]
[TD]JOSE[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]MATTHEW[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]MATTHEW[/TD]
[TD]7[/TD]
[TD]GARY[/TD]
[TD][/TD]
[TD]TIMOTHY[/TD]
[TD]4[/TD]
[TD]JOSE[/TD]
[TD][/TD]
[TD]LARRY[/TD]
[TD]4,5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]GAR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R]
[TD][/TD]
[TD]GREGORY[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]GREGORY[/TD]
[TD][/TD]
[TD]KEVIN[/TD]
[TD][/TD]
[TD]NIMA[/TD]
[TD]6[/TD]
[TD]MATTHEW[/TD]
[TD]8[/TD]
[TD]GARY[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Peter[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Then I have made a userform with a combobox for the names and a textbox for the time entry. An OK button to add the time to the name and a Close button to close the form.
image sharing
The combobox I gave the name cbxNames, the textbox tbxHours, the 'Copy to sheet' button btnOK, the cancel button btnCancel
This leads to the following userform code to make it work:
Code:
Option Explicit
Private Sub btnCancel_Click()
Unload Me
End Sub
Private Sub btnOK_Click()
'find name in table1 and add hours in column behind
Dim rFound As Range
Dim vSp As Variant
vSp = Split(tbxHours, ":")
Set rFound = ActiveSheet.ListObjects("Table1").DataBodyRange.Find(what:=cbxNames)
rFound.Offset(0, 1) = vSp(0) + vSp(1) / 60
End Sub
Private Sub tbxHours_Enter()
tbxHours = ""
End Sub
Private Sub tbxHours_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Len(tbxHours.Value) = 0 Then
tbxHours.Value = "00:00"
ElseIf Len(tbxHours.Value) = 4 Then
tbxHours.Value = "0" & tbxHours.Value
End If
If IsDate(tbxHours.Value) And Len(tbxHours.Text) = 5 Then
Else
MsgBox "Input Hour like this Example 05:35"
tbxHours.Text = "00:00"
End If
End Sub
Private Sub UserForm_Initialize()
With cbxNames
.RowSource = Blad2.ListObjects("Table4").ListColumns(1).DataBodyRange.Address
End With
tbxHours = "00:00"
End Sub