I am using Excel 2010
I have a problem as shown in the attached sample data
In the directory C:\Product\Pictures I have many files with the names
shown in Column A under the Code group eg: 1.jpg, 2.jpg ….and so on
The size of inserted picture should be of the same height and width of the
cell in
Here is the code, you can make changes or experiment with it
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
On Error Resume Next
If Target.Column = 1 Then
Target.Offset(0, 1).Select
ActiveSheet.Pictures.Insert("C:\Product\Pictures\" &
Thanks for the quick response.
It works only for 1.jpg and not for any other pictures.
Kindly look into the code
thanks once again.
On Sat, Aug 1, 2015 at 12:00 AM, De Premor wrote:
> Here is the code, you can make changes or experiment with it
>
> Private Sub Worksheet_BeforeDoubleClick(ByV
Are you sure ?
i've been test and try the code, and it work for any other picture.
Did you know how that code work ?
let me explain a little
/*) //the code is in blue, and green is my comment /
*'This code will only executed before you double clicking on any cells /
ranges on sheet*
*Private Su
Hi,
Still curious with your problem, there is few more thing we need to check.
1. Make sure picture that you want to load is exist in the referenced
folder on the code
2. Make sure it image with JPG format, not PNG, GIF, BMP or other image
format, just JPG (the extention is .jpg)
Thanks, wait
No...sorry...I have checked everything. It only takes the file 1.jpg...and
not any other files.
The files are there in the folder and they are in jpg format.
That is the reason I sent the sample pics folder for testing on your end
May be you can give me a code which should run looking at values in
check this out !!
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
' MsgBox Target.Value2
If Target.Column = 1 Then
Target.Offset(0, 1).Select
ActiveSheet.Pictures.Insert("C:\Users\Mandeep.baluja\Desktop\a\" &
Target.Value2 & ".jpg").Select
Thanks Mandeep...for the code.
One small issue
I want the respective picture to be deleted
Now if I delete any value in Col A then it deletes all the pictures.
Can you please rectify.
If the value in Col A is deleted then only the respective pictures in Col B
should be deleted .. and not all the pi
check once again :) Regards Mandeep
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
' MsgBox Target.Value2
If Target.Column = 1 Then
Target.Offset(0, 1).Select
ActiveSheet.Pictures.Insert("C:\Users\Mandeep.baluja\Desktop\a\" &
Target.Value2 & ".j
Superr...wow...
Thanks a million
Also thanks to De Premor for his help too.
God Bless you all
On Mon, Aug 3, 2015 at 9:19 PM, Mandeep Baluja
wrote:
> check once again :) Regards Mandeep
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> On Error Resume Next
>' MsgBox Targe
10 matches
Mail list logo