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

หมวดคอมพิวเตอร์ => ห้องเว็บและโปรแกรม => หัวข้อที่ตั้งโดย: วัชรากรณ์ ศักดิ์บูรณะ เมื่อ 24 พ.ย 22, 09:36:58

ชื่อ: Excel
โดย: วัชรากรณ์ ศักดิ์บูรณะ เมื่อ 24 พ.ย 22, 09:36:58
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
-----------------------------------------------
========================

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