回覆列表
  • 1 # 羊毛學院

    下面是插入圖片的程式碼:123456789101112131415161718192021222324252627282930313233Private Sub CommandButton1_Click() Dim istr As String istr = Dir(ThisWorkbook.Path & "\Excel房型\*.jpg") Do While istr <> "" n = n + 1 Cells(n, "A") = ThisWorkbook.Path & "\Excel房型\" & istr istr = Dir LoopEnd Sub Private Sub CommandButton2_Click() Dim ss As Shape For Each ss In Me.Shapes "刪除除了命令按鈕之外的所有控制元件 If Left(ss.Name, 13) <> "CommandButton" Then ss.Delete Next Dim i As Long For i = 1 To [a65536].End(3).Row If Cells(i, "A") = "" Then MsgBox "請先點選“生成圖片路徑按鈕”。" Exit Sub End If "下面的程式碼插入圖片 " 路徑和檔名 左邊 上邊 圖片寬度 圖片高度 Me.Shapes.AddPicture Cells(i, "A").Value, True, True, [b1].Left, Cells(i, "B").Top, Cells(i, "B").ColumnWidth * 6.2, Cells(i, "B").RowHeight NextEnd Sub

  • 中秋節和大豐收的關聯?
  • 手機電池被鎖定了衝不進去電怎麼辦?