![]() We've got two variables here: photoNameAndPath and photo itself. ![]() ![]() Once the code starts, we use the Dim statement to determine the variable's type. Height = ActiveSheet.Range( "A1").Height If photoNameAndPath = False Then Exit Sub PhotoNameAndPath = Application.GetOpenFilename(Title:=" Select Photo to Insert ") We're going to go through the code bit by bit to make it easier to understand. Once you do, you can alter the code to insert photos in any cell in any size. To make this VBA code work for you the way you want, you need to understand it. In the next section, we're going to break down the code and explain the parameters at work. You can alter this, and also change the code to insert the picture in other cells or even a range of cells. Notice that the inserted picture is shrunk to fit cell A1.
0 Comments
Leave a Reply. |