Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Picture during Double Click
I'm trying to get the code in VBA to insert and remove a picture from a cell
when double clicked. Is this possible and how do I get the picture to center in the cell. Please fix this code. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Cancel = True If Target.Column = 8 Then If Trim(Target.Value) = "" Then Target.Value = Pictures.Insert("A:\Check.gif") Target.PicturePosition = fmPicturePositionCenter ElseIf Target.Value = ActiveSheet.Pictures.Insert("A:\Check.gif") Then Target.Value = ActiveSheet.Pictures.Delete("A:\Check.gif") Else MsgBox "Cannot toggle switch in " & Target.Address(0, 0) End If End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
double click excel file on the desktop excel opens but not file? | Excel Discussion (Misc queries) | |||
How do I double click a cell and jump to cell's referenced cell | Excel Discussion (Misc queries) | |||
I want open file for click double mouse | New Users to Excel | |||
Why Excel file doesn't open by double click. | Excel Discussion (Misc queries) | |||
Keyboard shortcut for double click in Excell cell | Excel Discussion (Misc queries) |