VBA_Noob_Help
New Member
- Joined
- May 22, 2023
- Messages
- 2
- Office Version
- 2016
- Platform
- Windows
As the title states, I have 0 knowledge about enabling a new image to be inserted into the next row. My code is as follows:
------------------------------------------------------------------------------------------------------------
MsgBox ("Ensure that e-Signature is in PNG/JPG format"), , ("IMPORTANT")
Dim fNameAndPath As Variant
Dim img As Shape
fNameAndPath = Application.GetOpenFilename(Title:="Attach e-Signature")
If fNameAndPath = False Then Exit Sub
Set img = ThisWorkbook.Sheets("Human Resource Store").Shapes.AddPicture(Filename:=fNameAndPath, _
LinkToFile:=False, SaveWithDocument:=True, _
Left:=1, Top:=1, Width:=-1, Height:=-1)
With img
'Resize Picture to fit in the range....
.Left = ThisWorkbook.Sheets("Human Resource Store").Range("G2").Left
.Top = ThisWorkbook.Sheets("Human Resource Store").Range("G2").Top
.Width = ThisWorkbook.Sheets("Human Resource Store").Range("G2").Width
.Height = ThisWorkbook.Sheets("Human Resource Store").Range("G2").Height
.Placement = 1
.DrawingObject.PrintObject = True
End With
ws_output = "Human Resource Store"
next_row = Sheets(ws_output).Range("B" & Rows.Count).End(xlUp).Offset(1).Row
Sheets(ws_output).Cells(next_row, 1).Value = Range("B5").Value
Sheets(ws_output).Cells(next_row, 2).Value = Range("B7").Value
Sheets(ws_output).Cells(next_row, 3).Value = Range("B9").Value
Sheets(ws_output).Cells(next_row, 4).Value = Range("B11").Value
Sheets(ws_output).Cells(next_row, 5).Value = Range("B13").Value
Sheets(ws_output).Cells(next_row, 6).Value = Range("B15").Value
MsgBox ("Successfully submitted. Please send the excel file back")
------------------------------------------------------------------------------------------------------------
I understand that I am setting it to G2 in another sheet, but I just have no clue on how to enable the image to go to row G3? Please help.
------------------------------------------------------------------------------------------------------------
MsgBox ("Ensure that e-Signature is in PNG/JPG format"), , ("IMPORTANT")
Dim fNameAndPath As Variant
Dim img As Shape
fNameAndPath = Application.GetOpenFilename(Title:="Attach e-Signature")
If fNameAndPath = False Then Exit Sub
Set img = ThisWorkbook.Sheets("Human Resource Store").Shapes.AddPicture(Filename:=fNameAndPath, _
LinkToFile:=False, SaveWithDocument:=True, _
Left:=1, Top:=1, Width:=-1, Height:=-1)
With img
'Resize Picture to fit in the range....
.Left = ThisWorkbook.Sheets("Human Resource Store").Range("G2").Left
.Top = ThisWorkbook.Sheets("Human Resource Store").Range("G2").Top
.Width = ThisWorkbook.Sheets("Human Resource Store").Range("G2").Width
.Height = ThisWorkbook.Sheets("Human Resource Store").Range("G2").Height
.Placement = 1
.DrawingObject.PrintObject = True
End With
ws_output = "Human Resource Store"
next_row = Sheets(ws_output).Range("B" & Rows.Count).End(xlUp).Offset(1).Row
Sheets(ws_output).Cells(next_row, 1).Value = Range("B5").Value
Sheets(ws_output).Cells(next_row, 2).Value = Range("B7").Value
Sheets(ws_output).Cells(next_row, 3).Value = Range("B9").Value
Sheets(ws_output).Cells(next_row, 4).Value = Range("B11").Value
Sheets(ws_output).Cells(next_row, 5).Value = Range("B13").Value
Sheets(ws_output).Cells(next_row, 6).Value = Range("B15").Value
MsgBox ("Successfully submitted. Please send the excel file back")
------------------------------------------------------------------------------------------------------------
I understand that I am setting it to G2 in another sheet, but I just have no clue on how to enable the image to go to row G3? Please help.