Awesome!!! VBA is great and fun! I wonder if we may use type function instead of clicking from drop down list to show the same result? Since practically speaking if we have more data it would be convenient to type 001 (Let's say employee I.D.) instead. Thanks!!!
Thanks Dan. Great idea. Wonder if you could use this to choose charts? Create a chart on a hidden tab, copy and paste as picture somewhere, then refer to it like you explained. You think?
Good stuff. Is there any way to configure the user form so that in addition to images, each click of the box would also pull an object like a pdf file?
Thanks. How it works when picture is related to two criteria not only one. For being more clear, there are different pictures that have the first criteria the same and the second different. let say the same PIN but different Description within the context of your video.
Hello Dan , learning so much from your videos!!! I have a question. I am trying to load a pdf file of an application database into a control acropdf1. here is my code but it does not work. Private Sub cmbapp_Change() On Error Resume Next Dim mypdf As String mypdf = Me.cmbapp.List(Me.cmbapp.ListIndex, 2) Me.AcroPDF1.LoadFile (mypdf) End Sub I was hoping you could shed some light on what i am doing wrong.
Can something similar be done with videos. I have some training videos that I want the user to access through a combo box in a form. When they clicked on the file name then it would start the video.
I got it to work. I put Hyperlinks in the named range for each video then used this code in the combo box click event Private Sub ComboBox1_Click() Dim Sht1 As Worksheet Set Sht1 = ThisWorkbook.Sheets("Sheet1") Sht1.Cells.Find(ComboBox1.Value).Hyperlinks(1).Follow End Sub ExcelVbaIsFun
@excelvbalsfun i am working on my educational project and looking for the same thing to show photos depending on combobox drop down. i repeat the same procedure many time but failed to run the macro. the code i get is variable is not defined. as in your example, you have assume/assign a code as "myImg" what ever i put , i get the error the variable is not defind. please guide to do the necessary thing at the earliest. thank you in advance.
I've tried this and it works great for absolute paths, but I'd like to set up a hyperlink base and just have the file name under the image column. so in document properties i set the hyperlink base to C:\Images\ then in the cell i type image001.jpg. I've tried this out, but it keeps popping up an error saying the file can't be found even though i KNOW the files are there and i've pointed it to the right location. What am i missing?
+Lance Yeun can we see your code? When you debug through, is there possibly an extra or a missing backslash, such as C:\imagesmypic.jpg or C:\images\\mypic.jpg ? Also make sure you use a \ and not a /. Hmm other than that I'd need to see the code I think. Thanks Dan
Resim üzerinde iken sağ klik ile açılan pencerede en altta yer alan "Özellikler" tıklayınız. Güvenlik sekmesini tıklayınız, hemen altında "Nesne Adı" karşısındaki resim adresini kopyalayıp excel'e yapıştırınız. Bu şekilde yaptınız mı? Teşekkürler.
Hi again, i have a new question for you that i really want to have some light on, because i have been trying to fix this issue for ages and i have yet to find a work-around :/ Sometimes, happens randomly it seems, i get the error: "Invalid picture", when i am trying to show a "chart" from excel on my userform. I am doing this by saving the chart to my workbook location and then exporting it onto my userform. It have worked for sometime, but suddenly it gives me "invalid picture" and i dont know what to do :/ Sincerely, Peyko.
Thanks for the video! Such magic with VBA!
Thanks, ExcelIsFun. Yes Excel sure is magical. Thanks for showing us all that.
Can the photos be saved in one of the worksheet instead of using the location from computer?
Awesome!!! VBA is great and fun!
I wonder if we may use type function instead of clicking from drop down list to show the same result? Since practically speaking if we have more data it would be convenient to type 001 (Let's say employee I.D.) instead.
Thanks!!!
yes, with a combobox, you do just that! You can type OR select with mouse. It's fun!
Thanks Dan. Great idea. Wonder if you could use this to choose charts? Create a chart on a hidden tab, copy and paste as picture somewhere, then refer to it like you explained. You think?
Let's look into it, krn14242. Nothing's impossible, only certain things are difficult or may take time to create. :)
Did it. Works just like your video explains except I copied and pasted charts as pictures.
Good stuff. Is there any way to configure the user form so that in addition to images, each click of the box would also pull an object like a pdf file?
Is there a way to add the images to clipboard (copy) so that I may paste them onto another document?
Just wondering if we could do a word file instead of image ???
Thanks. How it works when picture is related to two criteria not only one. For being more clear, there are different pictures that have the first criteria the same and the second different. let say the same PIN but different Description within the context of your video.
Hello Dan , learning so much from your videos!!! I have a question. I am trying to load a pdf file of an application database into a control acropdf1.
here is my code but it does not work.
Private Sub cmbapp_Change()
On Error Resume Next
Dim mypdf As String
mypdf = Me.cmbapp.List(Me.cmbapp.ListIndex, 2)
Me.AcroPDF1.LoadFile (mypdf)
End Sub
I was hoping you could shed some light on what i am doing wrong.
Grazie, funziona bene
Bene! So glad it helped!
thanks for this video....good lesson...
How to do if next n previous image ?.
Sir, how to display family tree with photos on userform in excel vba...
thanks. Sir,
Sir please help, I have my image/picture inside my excel sheet. How to display it on userform? pls help. thanks.
hello sir can you reverse the method..now pic from the user form to spread sheet pls
Are you available to answer questions?
Can something similar be done with videos. I have some training videos that I want the user to access through a combo box in a form. When they clicked on the file name then it would start the video.
Probably, there may be an additional activex control somewhere one can pop into the userform after activating or installing.
I got it to work. I put Hyperlinks in the named range for each video then used this code in the combo box click event
Private Sub ComboBox1_Click()
Dim Sht1 As Worksheet
Set Sht1 = ThisWorkbook.Sheets("Sheet1")
Sht1.Cells.Find(ComboBox1.Value).Hyperlinks(1).Follow
End Sub
ExcelVbaIsFun
Great job, Scott!
@excelvbalsfun i am working on my educational project and looking for the same thing to show photos depending on combobox drop down. i repeat the same procedure many time but failed to run the macro. the code i get is variable is not defined. as in your example, you have assume/assign a code as "myImg" what ever i put , i get the error the variable is not defind. please guide to do the necessary thing at the earliest. thank you in advance.
Hi Umair,
Please remove Option Explicit from the top of your module in order to not have to declare every variable.
Thanks
Dan
how if i want to preview a pdf file on my user form ?
I've tried this and it works great for absolute paths, but I'd like to set up a hyperlink base and just have the file name under the image column. so in document properties i set the hyperlink base to C:\Images\ then in the cell i type image001.jpg. I've tried this out, but it keeps popping up an error saying the file can't be found even though i KNOW the files are there and i've pointed it to the right location. What am i missing?
+Lance Yeun can we see your code? When you debug through, is there possibly an extra or a missing backslash, such as C:\imagesmypic.jpg or C:\images\\mypic.jpg ?
Also make sure you use a \ and not a /. Hmm other than that I'd need to see the code I think.
Thanks
Dan
the file doesnt work, it doesn´t have the Vba code. but thanks any way
I only can see first column!! why?
Resim üzerinde iken sağ klik ile açılan pencerede en altta yer alan "Özellikler" tıklayınız. Güvenlik sekmesini tıklayınız, hemen altında "Nesne Adı" karşısındaki resim adresini kopyalayıp excel'e yapıştırınız. Bu şekilde yaptınız mı? Teşekkürler.
Hi again,
i have a new question for you that i really want to have some light on, because i have been trying to fix this issue for ages and i have yet to find a work-around :/
Sometimes, happens randomly it seems, i get the error: "Invalid picture", when i am trying to show a "chart" from excel on my userform. I am doing this by saving the chart to my workbook location and then exporting it onto my userform.
It have worked for sometime, but suddenly it gives me "invalid picture" and i dont know what to do :/
Sincerely,
Peyko.
Can you send me what you've got so far to Excelvbaisfun@gmail.com and I'll have a look, Peyko? Thanks! Dan