ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,235
- Office Version
- 2007
- Platform
- Windows
Morning,
I have the code below in use but something isnt right.
My intention is that when i double click in a cell of column B the code will run BUT should a user double click in another column nothing will happen.
This is what happens.
I double click in column B & the code runs fine like it should.
However if i double click in any other column cell its like ive pressed F2 & now allowing to to make an edit ??
I see the flashing cursor in between the characters as if i was to delete / make a change.
Can you see what ive done wrong.
Thanks
I have the code below in use but something isnt right.
My intention is that when i double click in a cell of column B the code will run BUT should a user double click in another column nothing will happen.
This is what happens.
I double click in column B & the code runs fine like it should.
However if i double click in any other column cell its like ive pressed F2 & now allowing to to make an edit ??
I see the flashing cursor in between the characters as if i was to delete / make a change.
Can you see what ive done wrong.
Thanks
Rich (BB code):
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim Lastrow As Long
If ActiveCell.Column = 2 Then
Lastrow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
If Not Intersect(Target, Range("B8:B" & Lastrow)) Is Nothing Then
Cancel = True
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
With Worksheets("MCVIN")
.Activate
.Range("F7").Value = Target.Value
End With
Else
Exit Sub
End If
MotorcycleBikeInfo.Show
End If
End Sub