• Welcome to EarnTheStar WebBoard : เอิร์น เดอะสตาร์ เว็บบอร์ด.
 

Excel

เริ่มโดย วัชรากรณ์ ศักดิ์บูรณะ, 24 พ.ย 22, 09:36:58

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

วัชรากรณ์ ศักดิ์บูรณะ

Excel แทรกรูปลงในเซลอย่างไรให้พอดีอัตโนมัติ
ครูอภิวัฒน์"สอนสร้างสื่อ"

code:
---------------------------------------
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
-----------------------------------------------
========================

วัชรากรณ์ ศักดิ์บูรณะ