Excel : EP66 แทรกรูป excel ให้พอดีเซลล์ ง่ายและละเอียดแบบสุดๆ! (code อยู่ใต้คลิป copy ไปใช้เลยครับ)

Поділитися
Вставка
  • Опубліковано 11 вер 2024
  • #แทรกรูปพอดีเซล์ #แทรกรูปexcel
    code ที่ใช้ ให้ copy จากบรรทัด dim ถึงบรรทัด set ครับ
    ------------------------------------------
    Dim sPicture As String, pic As Picture
    sPicture = Application.GetOpenFilename _
    ("Pictures (*.gif; *.jpg; *.bmp; *.tif), *.gif; *.jpg; *.bmp; *.tif", _
    , "please select picture as you want")
    If sPicture = "False" Then Exit Sub
    Set pic = ActiveSheet.Pictures.Insert(sPicture)
    With pic
    .ShapeRange.LockAspectRatio = msoFalse
    .Height = ActiveCell.Height
    .Width = ActiveCell.Width
    .Top = ActiveCell.Top
    .Left = ActiveCell.Left
    .Placement = xlMoveAndSize
    End With
    Set pic = Nothing
    ---------------------------------------------------
    ใน code จะสามารถใช้ไฟล์ภาพ *.gif; *.jpg; *.bmp; *.tif ตามนี้
    sPicture = Application.GetOpenFilename _
    ("Pictures (*.gif; *.jpg; *.bmp; *.tif), *.gif; *.jpg; *.bmp; *.tif", _
    , "please select picture as you want")
    แต่ ถ้าต้องการ file นามสกุลอื่นใส่เพิ่มได้ครับ เช่น ต้องการ ไฟล์ png ก็ใส่เพิ่มแบบนี้ครับ
    sPicture = Application.GetOpenFilename _
    ("Pictures (*.gif; *.jpg; *.bmp; *.tif, *.png), *.gif; *.jpg; *.bmp; *.tif; *.png", _
    , "please select picture as you want")
    ขอความกรุณาช่วยกดติดตาม กดไลด์ กดแชร์ด้วยเพื่อเป็นกำลังใจในการทำคลิปต่อๆ ไปด้วยน่ะครับ

КОМЕНТАРІ • 64