ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

vba ¦p¦ó­×§ï·s¼W¤½¦¡ ¥i¥H¦Û°Ê¶K¤U¤@±Æ

¦^´_ 1# Muffledsatyr


«á¾Ç©È»~·|·N«ä¡A½Ð°Ý¥i¥H¤W¶Ç½d¨Ò¶Ü? ³o¼Ë¤ñ¸û®e©ö¤F¸Ñ¡A·PÁ¡C

TOP

¦^´_ 3# Muffledsatyr

½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ
¥t¥~¡A¦³ÂI¤£¸Ñ´N¬O§A¤£¬O­ì¨Ó´N¦³¼gµ{¦¡¤F¶Ü?


Sub InsertPictures()
'Update 20140513
Dim PicList() As Variant
Dim PicFormat As String
Dim Rng As Range
Dim sShape As Shape
On Error Resume Next
PicList = Application.GetOpenFilename(PicFormat, MultiSelect:=True)
xColIndex = Application.ActiveCell.Column
If IsArray(PicList) Then
     xRowIndex = Application.ActiveCell.Row
     For lLoop = LBound(PicList) To UBound(PicList)
        If xColIndex > 5 Then xRowIndex = xRowIndex + 1: xColIndex = 1
        Set Rng = Cells(xRowIndex, xColIndex)
        Set sShape = ActiveSheet.Shapes.AddPicture(PicList(lLoop), msoFalse, msoCTrue, Rng.Left, Rng.Top, Rng.Width, Rng.Height)
        xColIndex = xColIndex + 1
     Next
End If
End Sub

TOP

¦^´_ 5# Muffledsatyr

©T©w±qA1 ¶}©l±Æ¦C¡A½Ð¸Õ¬Ý¬Ý¡AÁÂÁÂ

Sub tt()
Dim PicList, PicFormat$, Rng As Range, sShape As Shape, i&, X%, Y%
PicList = Application.GetOpenFilename(PicFormat, MultiSelect:=True)
X = 1 '±qA1¶}©l
If IsArray(PicList) Then
    For i = 1 To UBound(PicList)
        Y = Y + 1
        If Y > 5 Then X = X + 1: Y = 1   '5±i-->´«¤U¤@¦C
        Set Rng = Cells(X, Y)  '¶K¤W·Ó¤ùªº¦ì¸m
        Set sShape = ActiveSheet.Shapes.AddPicture(PicList(i), msoFalse, msoCTrue, Rng.Left, Rng.Top, Rng.Width, Rng.Height)
    Next
End If
End Sub

TOP

¦^´_ 12# Muffledsatyr

¹Ï¤ù°ª«×5.79¤½¤À ¼e«×7.72¤½¤À¦³¿ìªk¥[¤J¶Ü?
Set sShape = ActiveSheet.Shapes.AddPicture(PicList(i), msoFalse, msoCTrue, Rng.Left, Rng.Top, Rng.Width, Rng.Height)  
Rng.Width , Rng Height ¥i¥Hª½±µ§ï¦¨§A»Ý­nªº¼Æ­È¦p¤U¡A¦pªG¤£§ï´N¬O¨Ì·Óexcel¹ê»Ú¤j¤p¶K¤J
Set sShape = ActiveSheet.Shapes.AddPicture(PicList(i), msoFalse, msoCTrue, Rng.Left, Rng.Top, 7.72, 5.79)

TOP

¦^´_ 12# Muffledsatyr

½Ð´ú¸Õ¬Ý¬Ý¡A¤£¤Ó¤F¸Ñ¬O¤£¬O§A­nªºµ²ªG¡AÁÂÁÂ

Sub tt2()
Dim PicList, PicFormat$, Rng As Range, sShape As Shape, i&, X%, Y%
PicList = Application.GetOpenFilename(PicFormat, MultiSelect:=True)
X = 1
If IsArray(PicList) Then
    For i = 1 To UBound(PicList)
        Y = Y + 1
        If Y > 5 Then X = X + 1: Y = 1    '5±i´«¤U¤@¦C
        Set Rng = Cells(X, Y)
        Cells(X, Y).ColumnWidth = 42  '³]©wexcel¼e«×
        Cells(X, Y).RowHeight = 170   '³]©wexcel°ª«×
        Set sShape = ActiveSheet.Shapes.AddPicture(PicList(i), msoFalse, msoCTrue, Rng.Left, Rng.Top, 7.72, 5.79)  '¼Æ¦r¥i³]©w·Ó¤ù¼e°ª
    Next
End If
End Sub

TOP

¦^´_ 15# Muffledsatyr

½Ð¦A´ú¸Õ¬Ý¬Ý¡A¬O¤£¬O±zªº»Ý¨D¡AÁÂÁÂ

¹Ï¤ù¦bExcel°ª«×5.79¤½¤À ¼e«×7.72¤½¤À
¤U¦Cµ{¦¡½X»Ý­×§ï¼Æ­È¦p¤U, ¥¼¨Ó¥i¦Û¦æ­×§ï©Ò»Ý
°ª«×: 5.79 / 0.0353 = 164
¼e«×: 7.72 / 0.0353 = 219

Set sShape = ActiveSheet.Shapes.AddPicture(PicList(i), msoFalse, msoCTrue, Rng.Left, Rng.Top, 219, 164)  '¼Æ¦r¥i³]©w·Ó¤ù¼e°ª

TOP

        ÀR«ä¦Û¦b : ¤f»¡¦n¸Ü¡B¤ß·Q¦n·N¡B¨­¦æ¦n¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD