Dim w&
Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Frame1.Visible = True
Frame1.ZOrder 0
With ListBox1
If X > Cells(1).Width Then xx = Cells(1).Width: w = 2 Else xx = 0: w = 1
Frame1.Top = .Top + (10.3 * .ListIndex)
Frame1.Left = .Left + xx
Frame1.Height = 13
Frame1.Width = Cells(w).Width
TextBox1.Width = Cells(w).Width
TextBox1.Height = 13
TextBox1.Top = 0
TextBox1.Value = .List(.ListIndex, w - 1)
End With
End Sub
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then
With ListBox1
.List(.ListIndex, w - 1) = TextBox1.Value
End With
Frame1.Visible = False
End If
End Sub
Private Sub UserForm_Activate()
With ListBox1
.List = Cells(1, 1).Resize(5, 2).Value
.ColumnCount = 3
.ColumnWidths = Cells(1).Width & "pt;" & Cells(2).Width & "pt"
End With
End Sub