Hi
I have a userform which opens when a specific cell is double clicked on a worksheet. This userform has two textboxes which bring up information from another part of the worksheet. My code is below is written on the worksheet itself. The userform opens upon double clicking but the data retrieved by the userform is for the previous double click. For example the first time I double-click on C9 both boxes are blank. The next time I click on Cell C9 it correctly returns values in cells C109 and C209. If I then clicked on Cell D9, it would then return the values I would have expected for C9.
Please can you advise if I am missing some code or if the with userform instructions are in the wrong place?
Private Sub Worksheet_beforedoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("C8:CL100")) Is Nothing Then
Marketinfo.Show
With Marketinfo
.txtAddinfo = Target.Offset(200, 0).Value
.txtSSI = Target.Offset(100, 0).Value
End With
Cancel = True
End If
End Sub
Thanks very much
Bookmarks