I have source code below that enables me to place data in cells, I am happy with how it works, but would like to add some additional features:
1. Update automatically upon opening file
2. Center and lock images into cell.
3. If an image is not available in the path folder then leave it empty.
Attached is an image of the original source file; I have changed the code a bit.
Public Sub Insert_File()
Dim i As Integer
Dim J As Integer
Dim num As Integer
num = 0
Dim arr3
Dim col As Integer
col = 0
arr3 = Array("A", "B", "C", "D", "E", "F", "G")
ActiveSheet.Pictures.Delete
Columns("A:G").ColumnWidth = 41
Rows("1:4").RowHeight = 195
For i = 1 To 4
col = 0
For J = 1 To 7
num = num + 1
Cells(i, J).Value = 1 + num & ".jpg"
Filename = "C:\Users\isaac\Downloads\inser\" & 1 + num & ".jpg"
With ActiveSheet.Pictures.Insert(Filename)
.Left = ActiveSheet.Range(arr3(col) & i).Left
.Top = ActiveSheet.Range(arr3(col) & i).Top + 1
.Placement = 1
col = col + 1
End With
Next J
Next i
End Sub
1. Update automatically upon opening file
2. Center and lock images into cell.
3. If an image is not available in the path folder then leave it empty.
Attached is an image of the original source file; I have changed the code a bit.
Public Sub Insert_File()
Dim i As Integer
Dim J As Integer
Dim num As Integer
num = 0
Dim arr3
Dim col As Integer
col = 0
arr3 = Array("A", "B", "C", "D", "E", "F", "G")
ActiveSheet.Pictures.Delete
Columns("A:G").ColumnWidth = 41
Rows("1:4").RowHeight = 195
For i = 1 To 4
col = 0
For J = 1 To 7
num = num + 1
Cells(i, J).Value = 1 + num & ".jpg"
Filename = "C:\Users\isaac\Downloads\inser\" & 1 + num & ".jpg"
With ActiveSheet.Pictures.Insert(Filename)
.Left = ActiveSheet.Range(arr3(col) & i).Left
.Top = ActiveSheet.Range(arr3(col) & i).Top + 1
.Placement = 1
col = col + 1
End With
Next J
Next i
End Sub