I'm very new to VBA and hope this is not a too-nooby-question.
I want to add PNG graphic to an Excel sheet by using a macro. Recording the macro and using it then is easy. But what I want: When I execute the macro, it should read a specific cell's content and import a graphic that has that cell's content (or a part of it) as it's name from a defined folder.
Do you understand? I want to do one click and it adds the correct graphics to my worksheets by checking the content of a cell in the worksheet.
EDIT: I managed to Import the Graphic, but it has the wrong size. How can I change that? My Code right now:
Sub GraphicfileInZelleEinfuegen_Reaktionszeit()
Dim strPfad As String
Dim strDatei As String
Dim lngZeile As Long
Dim lngSpalte As Long
Dim wksTabelle As Worksheet
Dim shpNeu As Object
Dim Modulnummer As Integer
lngSpalte = 3 ' = C
lngZeile = 22
Set wksTabelle = ActiveWorkbook.Worksheets("max_force_auslesen_Modul1")
strPfad = wksTabelle.Cells(18, 10).Text
If Right(strPfad, 1) <> "\" Then strPfad = strPfad & "\"
strDatei = wksTabelle.Cells(19, 10).Text
Set shpNeu = wksTabelle.Pictures.Insert(strPfad & strDatei)
shpNeu.Top = wksTabelle.Rows(lngZeile).Top 'Einzufügende Zeile
shpNeu.Left = wksTabelle.Columns(lngSpalte).Left
shpNeu.Height = wksTabelle.Rows(600).Height
shpNeu.Width = 111
End Sub