Home > other >  How EXCEL the entire file is set to "size and position change from cell"?
How EXCEL the entire file is set to "size and position change from cell"?

Time:01-14

Masters, need to set the EXCEL file to "size and position change from cell" (note: shall be separately set again after not insert images), namely, the insert images can automatically adjust for size and position change from cell ", anyone can master teach? If you can provide the whole VBA content will be appreciated, thank you!!!!!!

CodePudding user response:

What I want to know, haven't solve?

CodePudding user response:

reference 1st floor weixin_41015181 response:
is just what I want to know, is not yet solved,

How to realize the insert of the transparent background picture?

CodePudding user response:

Private Sub Workbook_Open ()
Sheets (1). Shapes (1.) Select
With the Selection. The ShapeRange
. LockAspectRatio=msoFalse
Left=Sheets (1). The Range (" A1 "). The Left
Top=Sheets (1). The Range (" A1 "). The Top
Width=Sheets (1). The Range (" A1 "). The Width
Height=Sheets (1). The Range (" A1 "). The Height
End With
End Sub

Private Sub Workbook_SheetSelectionChange (ByVal Sh As Object, ByVal Target As Range)
Sheets (1). Shapes (1.) Select
With the Selection. The ShapeRange
. LockAspectRatio=msoFalse
Left=Sheets (1). The Range (" A1 "). The Left
Top=Sheets (1). The Range (" A1 "). The Top
Width=Sheets (1). The Range (" A1 "). The Width
Height=Sheets (1). The Range (" A1 "). The Height
End With
End Sub

CodePudding user response:

Can also be more simple:
Private Sub Workbook_Open ()
Sheets (1). Shapes (1.) Select
With Selection
The Placement=xlMoveAndSize
. PrintObject=True
End With
With the Selection. The ShapeRange

. LockAspectRatio=msoFalse
Left=Sheets (1). The Range (" A1 "). The Left
Top=Sheets (1). The Range (" A1 "). The Top
Width=Sheets (1). The Range (" A1 "). The Width
Height=Sheets (1). The Range (" A1 "). The Height
End With
End Sub

CodePudding user response:

Set the worksheet mouse click events:
Private Sub Worksheet_BeforeDoubleClick (ByVal Target As the Range, and Cancel the As Boolean)
If the Target. The Column=4 Then
With the Application. The FileDialog (msoFileDialogFilePicker)
The Title="insert picture"
. AllowMultiSelect=True
. The Filters. The Clear
. Filters. The Add "bitmap file", "*.jpg; *.png; *. BMP
"If the Show Then
ActiveSheet. Shapes. AddShape (msoShapeRectangle, Target. Left, Target. Top Target. The Width of the Target. The Height). Select
Selection. The Name="P" & amp; Target. Row
Selection. The ShapeRange. The Fill. UserPicture. SelectedItems (1)

End the If
End With
End the If
End Sub

CodePudding user response:

To solve it,,, I now also need the method
  • Related