lengyel109
New Member
- Joined
- Jan 10, 2022
- Messages
- 4
- Office Version
- 365
- 2021
- 2019
- Platform
- Windows
Hi everyone!
I ran into some trouble trying to open the insert picture from file dialog box when double clicking a specific cell and then inserting the selected picture into the double clicked cell.
I was able to get a basic code working where if you double click a cell in a range, then gives you a msgBox with "Insert Picture" text.
Here comes the part where I just cannot find a working solution. Instead of giving the MsgBox I would like the Insert Picture from File dialog box to open, where I could select what I want to Insert and then insert the picture to the said cell. Later on I would think of resizing the pictures as well, but for now if this starts working, I could proceed to the next obstacle.
Any ideas? Or am I expecting something that would not work the way I want it?
Thanks in advance,
Mark
I ran into some trouble trying to open the insert picture from file dialog box when double clicking a specific cell and then inserting the selected picture into the double clicked cell.
I was able to get a basic code working where if you double click a cell in a range, then gives you a msgBox with "Insert Picture" text.
VBA Code:
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Selection.Count = 1 Then
If Not Intersect(Target, Range("F10:F28")) Is Nothing Then
'Only for testing to see if it works
MsgBox "Insert Picture"
End If
Cancel = True
End If
End Sub
Here comes the part where I just cannot find a working solution. Instead of giving the MsgBox I would like the Insert Picture from File dialog box to open, where I could select what I want to Insert and then insert the picture to the said cell. Later on I would think of resizing the pictures as well, but for now if this starts working, I could proceed to the next obstacle.
Any ideas? Or am I expecting something that would not work the way I want it?
Thanks in advance,
Mark