VBA Code for insert image or picture to cell

इस कोड को आपको कॉपी करना है और फिर एक्सेल के Microsoft Visual में जाकर Insert के Module के अंदर पेस्ट करना है और फिर इमेज आप इन्सर्ट कराये और Microsoft Visual को क्लोज करेगें तो एक्सेल सेल में सभी इन्सर्ट कराई गई इमेज दिखने लगेंगी ।

Sub InsertPictures()
Dim PicList() As Variant
Dim PicFormat As String
Dim Rng As Range
Dim sShape As Shape
On Error Resume Next
PicList = Application.GetOpenFilename(PicFormat, MultiSelect:=True)
xColIndex = Application.ActiveCell.Column
If IsArray(PicList) Then
    xRowIndex = Application.ActiveCell.Row
    For lLoop = LBound(PicList) To UBound(PicList)
        Set Rng = Cells(xRowIndex, xColIndex)
        Set sShape = ActiveSheet.Shapes.AddPicture(PicList(lLoop), msoFalse, msoCTrue, Rng.Left, Rng.Top, Rng.Width, Rng.Height)
        xRowIndex = xRowIndex + 1
    Next
End If
End Sub
Spread the love

Leave a Comment