Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
aftamath
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
double click excel file on the desktop excel opens but not file? JPT4266 Excel Discussion (Misc queries) 3 May 7th 09 04:24 PM
How do I double click a cell and jump to cell's referenced cell JerryJuice Excel Discussion (Misc queries) 2 September 10th 05 10:24 PM
I want open file for click double mouse I want open file for click double mouse New Users to Excel 1 July 17th 05 12:49 PM
Why Excel file doesn't open by double click. Siraj Excel Discussion (Misc queries) 1 February 6th 05 01:58 PM
Keyboard shortcut for double click in Excell cell Katherine Excel Discussion (Misc queries) 10 January 13th 05 12:28 AM


All times are GMT +1. The time now is 02:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"