• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Resim boyutu

Katılım
4 Haziran 2011
Mesajlar
21
Excel Vers. ve Dili
Excel mi o ne :D
Bu kod ile resim ekliyorum fakat genişliği ayarlıyamıyorum b hücresini geçmemesi lazım :(

Kod:
Sub InsertPictureInRange(PictureFileName As String, TargetCells As Range)
    ' inserts a picture and resizes it to fit the TargetCells range
    Dim p As Object, t As Double, l As Double, w As Double, h As Double
    If TypeName(ActiveSheet) <> "Worksheet" Then Exit Sub
    If Dir(PictureFileName) = "" Then Exit Sub
    ' import picture
    Set p = ActiveSheet.Pictures.Insert(PictureFileName)
    ' determine positions
         With TargetCells
        t = .top + 2
        l = .Left + 2
        w = .Width
                h = .Offset(.Rows.Count, 0).top - .top

    End With
    ' position picture
    With p
        .top = t
        .Left = l
        .Width = w - 5
        .Height = h - 5
    End With
    Set p = Nothing
End Sub
 
Geri
Üst