DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
pic.ShapeRange.Height = 90 satırı ile düzenleniyor. İsterseniz değiştirebilirsiniz.Sub Test()
Dim Bak As Long
Dim syf As Worksheet
Dim pic As Variant
With Worksheets("Sayfa1")
For Bak = 2 To .Cells(Rows.Count, "A").End(xlUp).Row
Set pic = .Pictures.Insert(ThisWorkbook.Path & "\" & .Cells(Bak, "A") & ".jpg")
pic.ShapeRange.Height = 90
pic.Top = Cells(Bak, "F").Top
pic.Left = Cells(Bak, "F").Left + 5
Next
End With
End Sub
pic.ShapeRange.Height = 90 satırı yerine pic.ShapeRange.Height = Cells(Bak, "F").Height satırını kopyalayın. Hangi hücreye göre boyutlanacaksa "F" yerine o hücrenin kolon harfini yazın.Sub Test()
Dim Bak As Long
Dim syf As Worksheet
Dim pic As Variant
Application.ScreenUpdating = False
With Worksheets("Sayfa1")
If .Shapes.Count > 0 Then .Shapes.SelectAll: Selection.Delete
.Columns("F").ColumnWidth = 20 'Kolon genişliği
For Bak = 2 To .Cells(Rows.Count, "A").End(xlUp).Row
.Rows(Bak).RowHeight = 90 'Satır genişliği
Set pic = .Pictures.Insert(ThisWorkbook.Path & "\" & .Cells(Bak, "A") & ".jpg")
pic.ShapeRange.Height = 90 'Foto yüksekliği
pic.Top = Cells(Bak, "F").Top 'Fotonun yukarıya konumu
pic.Left = Cells(Bak, "F").Left + 5 'Fotonun Sola konumu
Next
End With
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton2_Click()
Dim od As Workbook, nod As Workbook
Set od = ThisWorkbook
Application.ScreenUpdating = False
Application.DisplayAlerts = False
'Copy data that you want to save
Muko = Worksheets("Sayfa1").Range("H1")
od.Worksheets("Sayfa1").Range("A2:F9999").Select
Selection.Copy
' Add a new workbook
Set nod = Workbooks.Add
nod.Worksheets(1).Range("A1").PasteSpecial
ActiveCell.CurrentRegion.EntireColumn.AutoFit
'Save the new workbook
nod.SaveAs od.Path & "\" & Muko & " " & "Satış" & ".xlsx"
Application.DisplayAlerts = True
nod.Close True
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton2_Click()
Dim DosyaAdi As String
DosyaAdi = ThisWorkbook.Worksheets("Sayfa1").Range("H1")
ThisWorkbook.Worksheets("Sayfa1").Copy
Application.DisplayAlerts = True
ActiveWorkbook.Close True, ThisWorkbook.Path & "\" & DosyaAdi & " " & "Satış" & ".xlsx"
Application.ScreenUpdating = True
End Sub