Insert a UserForm, add two comboboxes a TextBox & a commandbutton.
This code will add load the comboboxes & enter input data
Option Explicit
Private Sub CommandButton1_Click()
Dim Col As Long
Dim Rw As Long
With Me
If .ComboBox1.ListIndex > 1 Then
Col = .ComboBox1.ListIndex + 2
Else: MsgBox "Please select a Week"
.ComboBox1.SetFocus
Exit Sub
End If
If .ComboBox2.ListIndex > 1 Then
Rw = .ComboBox1.ListIndex + 2
Else: MsgBox "Please select a week"
.ComboBox1.SetFocus
Exit Sub
End If
Sheet1.Cells(Rw, Col).Value = .TextBox1.Value
End With
End Sub
Private Sub UserForm_Initialize()
Dim rSource As Range
Dim i As Integer
For i = 1 To 52
Me.ComboBox1.AddItem i
Next i
With Sheet1 '<- check this is the correct sheet
Set rSource = .Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp))
Me.ComboBox2.List = rSource.Value
End With
End Sub
Bookmarks