HI, All
Here is a code which i have for getting pictures from a folder depending on a cell value (Roll No.)....
Private Sub Worksheet_Calculate()
Static OldVal As Variant
If Range("j7").Value <> OldVal Then
Image1.Picture = LoadPicture("D:\School Record on 13-8-14\General School Record\Students data and admission record\Picture record\" & Range("j7").Value & ".jpg")
OldVal = Range("j7").Value
End If
End Sub
now this code worked good but a single problem occurs while the picture is not present with the roll number given in the cell J7 then it shows the first picture and i need what, that it show nothing if this happens.
thanks
Here is a code which i have for getting pictures from a folder depending on a cell value (Roll No.)....
Private Sub Worksheet_Calculate()
Static OldVal As Variant
If Range("j7").Value <> OldVal Then
Image1.Picture = LoadPicture("D:\School Record on 13-8-14\General School Record\Students data and admission record\Picture record\" & Range("j7").Value & ".jpg")
OldVal = Range("j7").Value
End If
End Sub
now this code worked good but a single problem occurs while the picture is not present with the roll number given in the cell J7 then it shows the first picture and i need what, that it show nothing if this happens.
thanks