- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-7-15 18:29 ½s¿è
¦^´_ 3# Jared
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex()
- Dim i As Integer, R As Integer, C As Integer
- Dim S As String
- R = 10 '²Ä10Ó Image ¦Cªº¦ì¸m
- C = 1 '²Ä10Ó Image ø󪺦ì¸m
- With ActiveSheet
- i = 10
- On Error Resume Next
- Do
- .OLEObjects("Image" & i).Delete
- i = i + 1
- Loop Until Err <> 0
- Err.Clear
- On Error GoTo 0
- S = Dir(ThisWorkbook.Path & "\Test\*.gif")
- i = 0
- Do While S <> ""
- i = i + 1
- If i <= 9 Then
- .OLEObjects("Image" & i).Object.Picture = LoadPicture(ThisWorkbook.Path & "\Test\" & S)
- Else
- With .OLEObjects.Add(ClassType:="Forms.Image.1", Left:=.Cells(R, C).Left, Top:=.Cells(R, C).Top, Width:=.Cells(R, C).Resize(, 2).Width, Height:=.Cells(R, C).Resize(3).Height)
- .Name = "Image" & i
- .Object.Picture = LoadPicture(ThisWorkbook.Path & "\Test\" & S)
- R = R
- C = C + 2 'Image ¦³3Äæ(Äæ¼e=2)
- If C > 6 Then
- C = 1
- R = R + 3 'Image ¦³3¦C(¦C°ª=3¦C)
- End If
- End With
- End If
- S = Dir
- Loop
- i = i + 1
- On Error Resume Next
- Do
- If i <= 9 Then
- .OLEObjects("Image" & i).Object.Picture = LoadPicture("")
- End If
- i = i + 1
- Loop Until Err <> 0
- End With
- End Sub
½Æ»s¥N½X |
|