![]() Pictures object and put it into the object p that we declared earlier. In this line, we are using the Insert function of Activesheet. If you have not provided it, it will exit immediately and nothing will happen. If it does not, it will exit the code immediately and nothing will happen.Ĭheck that you have provided an address for the image to insert a photo into the excel cell. ![]() It checks whether the Activesheet is a worksheet or not. ![]() This line is just a variable declaration that we will need. Let’s dig into it.ĭim p As Object, t As Double, l As Double, w As Double, h As Double This is the main subroutine that inserts and resizes the picture to fit the given range. ![]() If Dir(PictureFileName) = "" Then Exit Sub If TypeName(ActiveSheet) "Worksheet" Then Exit Sub Sub InsertPictureInRange(PictureFileName As String, TargetCells As Range)' inserts a picture and resizes it to fit the TargetCells rangeDim p As Object, t As Double, l As Double, w As Double, h As Double
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |