VBA 를 사용 하여 EXCEL 에 그림 사용자 정의 함수 삽입(네트워크 URL/로 컬 URL)
1280 단어 VBA
Sub InsertPic(ByVal As String, ByVal As String, ByVal As String)
On Error Resume Next
Dim rng As Range
Set rng = Sheets( ).Range( )
With Sheets( ).Pictures.Insert( )
.ShapeRange.LockAspectRatio = msoFalse '
.Width = rng.Width - 3
.Height = rng.Height - 3
.Top = rng.Top + 1.5
.Left = rng.Left + 1.5
If Err.Number <> 0 Then
.Delete
Err.Clear
End If
End With
Set rng = Nothing
End Sub
Sub InsertPic2(ByVal As String, ByVal As String, ByVal As String)
On Error Resume Next
Dim rng As Range
Set rng = Sheets( ).Range( )
With Sheets( ).Shapes.AddShape(msoShapeRectangle, rng.Left + 1.5, rng.Top + 1.5, rng.Width - 3, rng.Height - 3).Select '
Selection.ShapeRange.Fill.UserPicture '
Selection.ShapeRange.Line.Visible = msoFalse '
If Err.Number <> 0 Then
Selection.Delete
Err.Clear
End If
End With
Set rng = Nothing
End Sub
Sub ()
Call InsertPic("http://www.baidu.com/img/bd_logo1.png", ActiveSheet.Name, "c1")
End Sub
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Excel VBA에서 SIR 모델을 구현합니다.신형 코로나 바이러스(COVID-19)의 환자수 추이를 나타내는 수리 모델 「SIR 모델」을 자주(잘) 보게 되었습니다. SIR 모델에서는 감염되지 않은 사람을 S(susceptible), 감염자를 I(infecti...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.