Hi - I know enough to be dangerous - this code gives me a userform1 in two columns on my spreadsheet that launches a "text box" to enter multi lines of text but does not return to single cell when you hit save. I know it can be done because the code is directly from another sheet where it works. What am I doing wrong? Is it some item line maybe in the userform section?
Any suggestions? I have attached the worksheet I am messing with. Thanks.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
' Only run if a cell in columns 7 (G), 8 (H) are double-clicked.
If Not Intersect(Target, Union(Columns(7), Columns(8))) Is Nothing Then
' Set the form's field to the cell contents
UserForm1.txtValue.Value = Target.Value
' Show the form
UserForm1.Show
' Cancel editing the cell
Cancel = True
End If
End Sub
Bookmarks