Pictures.Insert¡BShapes.AddShape¡BShapes.AddPicture®t§O ½Ð°ª¤â«üÂI
- ©«¤l
- 36
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 50
- ÂI¦W
- 0
- §@·~¨t²Î
- windows xp
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2014-2-20
- ³Ì«áµn¿ý
- 2015-3-6
|
Pictures.Insert¡BShapes.AddShape¡BShapes.AddPicture®t§O ½Ð°ª¤â«üÂI
¥Ø«e§Úªºµ{¦¡½XºKn¦p¤U(¥i¥H¦¨¥\°õ¦æ)¡G
Set myPic = ActiveSheet.Pictures.Insert(myPath & "\" & "1.jpg")
With myPic
.ShapeRange.LockAspectRatio = msoFalse
.Top = picNumRng.Offset(0, 1).Top
.Left = picNumRng.Offset(0, 1).Left
.Width = picNumRng.Offset(0, 1).MergeArea.Width
.Height = picNumRng.Offset(0, 1).MergeArea.Height
End With
°ÝÃD¦p¤U¡G
1.«á¨Óµo²{Pictures.Insert ¬O§Q¥Î³sµ²¤è¦¡Åª¨ú¤j¶q¹Ï¤ù¡A¨Ã«D±N¹Ï¤ù¶×¤J¨ìexcelÀɤº¡A¤£²Å»Ý¨D
2.¸g¹Lgoogleµo²{ http://blog.xuite.net/crdotlin/excel/9016086 ªº¸Ñªk¡Aª¾¹D¦³Shapes.AddShapeªº¤è¦¡
¦ý¬¡¶¤¤¦³³]p¤@Ó«ö¶s¡A¦pªGn«ü©w¯S©w¹Ï¤ù®É¡A¤]·|±N¸Ó«ö¶sºâ¦¨¤@ÓShape³y¦¨§xÂZ
3.«á¨Ó¦Aµo²{ https://tw.knowledge.yahoo.com/question/question?qid=1612072502639 ªº¸Ñªk
ª¾¹DShapes.AddPicture ªº¤è¦¡¡A¥u¬Ogoogle¤Îª¦¤F®a±Úªº¤å³¹¨Ã¨S¦³µo²{¥i¥H°Ñ¦Òªº¤å³¹
¦Û¤v¸ÕµÛ±N¤Wzªºµ{¦¡½X¤¤ªºPictures.Insert¥HShapes.AddPicture¨ú¥N«á°õ¦æ¡A¥u¬O¦b¤Wzµ{¦¡½X²Ä¤T¦æ
´N·|¥X²{¿ù»~¡A¤£ª¾¹D¦³µL¨ä¥L¤èªk¥i¥H²Å¦X¡u¶×¤J¹Ï¤ù¡v¡B¡u«ü©wÄæ¦ì´¡¤J¡v¤Î¡u½Õ¾ã¹Ï¤ù¤j¤p¡v¡H
4.¥t¥~§ä¨ìªº³oÓ¤èªk¤]¬O¤£¿ù http://blog.xuite.net/crdotlin/excel/9016086 ¥u¬OµLªk²z¸Ñ«ç»ò°µ
¡]¥i¥H±N³sµ²ªº¹Ï¤ù½Æ»s¨ì°Å¶Kï«á¡A¦A§ì¤U¨Ó ´£¨Ñ°Ñ¦Ò¡^ |
|
HELLO !!
|
|
|
|
|
- ©«¤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
|
¦^´_ 3# baconbacons - Option Explicit
- Const xP_First = "B3" '«ü©w²Ä£¸±i¹Ï¤ùªº¦ì¸m
- Const xP_Width = 5 '¹Ï¤ùªº¼e«×:¹Ï¤ùªº¦ì¸mÀx¦s®æÂX¥RªºÄæ¼Æ
- Const xP_Height = 5 '¹Ï¤ùªº°ª«×:¹Ï¤ùªº¦ì¸mÀx¦s®æÂX¥Rªº¦C¼Æ
- Const xP_¶¡¹j¦C = 6 '¹Ï¤ù¶¡ªº¶¡¹j¦C¼Æ
- Dim d As Object
- Sub Ex_¹Ï¤ù´¡¤J()
- Dim E As String, Rng As Range, Position As Integer, R As Integer
- xP_Seat
- With ActiveSheet
- If d.Count > 0 Then
- On Error Resume Next
- Position = InputBox("¥»¶p¦³ " & d.Count & " ·Ó¤ù", "«ü©w¦ì¸m", d.Count + 1)
- On Error GoTo 0
- If Position = 0 Then Exit Sub
- If Position <= d.Count Then
- Position = Position - 1
- Else
- Position = d.Count
- End If
- Else
- If MsgBox("·s¼W¹Ï¤ù !!", vbDefaultButton1 + vbYesNo) = vbYes Then
- Position = 0
- Else
- Exit Sub
- End If
- End If
- If d.Count > 0 Then
- For R = d.Count To Position + 1 Step -1 '¥Ñ¤U©¹¤W²¾°Ê¹Ï¤ù¨ì¤U±
- d(R).Top = d(R).TopLeftCell.Offset(xP_¶¡¹j¦C).Top
- Set d(R + 1) = d(R)
- Next
- End If
- R = .Range(xP_First).Row
- With .Range(xP_First).Offset(Position * xP_¶¡¹j¦C)
- If Position Mod 2 = 0 Then
- E = "http://forum.twbts.com/templates/discuz6/images/logotop.gif"
- Else
- E = "http://forum.twbts.com/uc_server/avatar.php?uid=16665&size=middle"
- End If
- With ActiveSheet.Shapes.AddPicture(E, True, True, .Left, .Top, .Resize(, xP_Width).Width, .Resize(xP_Height).Height)
- .Fill.UserPicture E
- Set d(Int((.TopLeftCell.Row - R) / xP_¶¡¹j¦C) + 1) = .OLEFormat.Object
- End With
- End With
- End With
- End Sub
- Sub Ex_¹Ï¤ù§R°£()
- Dim E As String, Rng As Range, Position As Integer, R As Integer
- xP_Seat
- With ActiveSheet
- If d.Count = 0 Then
- MsgBox "¨S¦³¹Ï¤ù¥i§R°£ !!"
- Exit Sub
- End If
- On Error Resume Next
- Position = InputBox("¥»¶p¦³ " & d.Count & " ·Ó¤ù" & vbLf & "¼Æ¦r¦p > " & d.Count & " ¬°§R°£©Ò¦³¹Ï¤ù", "§R°£¦ì¸m", d.Count)
- On Error GoTo 0
- If Position = 0 Then Exit Sub
- If Position > d.Count Then
- If MsgBox("§R°£©Ò¦³¹Ï¤ù !!", vbDefaultButton1 + vbYesNo) = vbYes Then xP_All_Delete
- Exit Sub
- End If
- d(Position).Delete
- For R = Position + 1 To d.Count '¥Ñ¤W©¹¤U²¾°Ê¹Ï¤ù¨ì¤W±
- d(R).Top = d(R).TopLeftCell.Offset(-xP_¶¡¹j¦C).Top
- Set d(R - 1) = d(R)
- Next
- d.Remove (d.Count)
-
- End With
- End Sub
- Private Sub xP_Seat() '¦rÂIª«¥ó: ¾É¤J¹Ï¤ùÄæ¦b«ü©wÄ檺·Ó¤ù
- Dim S As Shape, Rng As Range, R As Integer
- Set d = CreateObject("scripting.dictionary")
- With ActiveSheet
- With .Range(xP_First)
- Set Rng = .EntireColumn
- R = .Row
- End With
- For Each S In .Shapes
- If Not Intersect(Rng, S.TopLeftCell) Is Nothing Then '¹Ï¤ùTopLeftCell¬O¦bxP_First©Ò¦bªºÄæ
- Set d(Int((S.TopLeftCell.Row - R) / xP_¶¡¹j¦C) + 1) = S.OLEFormat.Object
- End If
- Next
- End With
- End Sub
- Private Sub xP_All_Delete() '§R°£¦ì¸m¦b(xP_First = "B1")Äæ©Ò¦³¹Ï¤ù
- Dim S As Shape, Rng As Range
- Set d = CreateObject("scripting.dictionary")
- With ActiveSheet
- Set Rng = .Range(xP_First).EntireColumn
- For Each S In .Shapes
- If Not Intersect(Rng, S.TopLeftCell) Is Nothing Then S.Delete
- Next
- End With
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 36
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 50
- ÂI¦W
- 0
- §@·~¨t²Î
- windows xp
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2014-2-20
- ³Ì«áµn¿ý
- 2015-3-6
|
¦^´_ 2# GBKEE
·PÁÂGBKEE¤jªº«ü¾É¡A½T¹ê¬O¥i¦æªº¡A¥t¥~©µ¦ù½Ð±Ð¤@ÓÃö©ó¶×¤J¹Ï¤ùªº°ÝÃD¡G
°²³]§Ú¥ý°õ¦æµ{¦¡¨Ã¡u¨Ì§Ç¡v¶×¤J¤F100±i¹Ï¤ù(°²³]¥ÑB1~B100±Æ¦C)¡A¥B«áÄò¦b²Ä57®æÄæ¦ì¡u·s¼W´¡¤J¡v¥t±i¹Ï¤ù¡Aì©l¹Ï¤ù§¡¶¶©µ±Æ§Ç¦Ü101®æ
¸g¹ê»Ú°õ¦æ¡Aì©lªº¹Ï¤ù¹q¸£·|»{©w³o100±iªº¹Ï¤ù¨Ì§Ç¬OShape(1)~Shape(100)¡AÁöµM«áÄò´¡¤J²Ä57±i¹Ï¤ù(¥Ñ¤W©¹¤Uºâ)¡A¦ý·|³Q»{©w¬°Shape(101)
¦]¦¹±µµÛ§Ú·Q¡u§R°£¡v²Ä60±i¹Ï¤ù¡]«ü¥Ñ¤W©¹¤Uºâ¡A¦ý¹q¸£»{©w¸Ó¹Ï¬°Shape(59)¡^¡A¹ê»Ú¤W§R°£ªº¨ä¹ê¬OShape(60)¡A¦Ó¤£¬O§Ú·Qn§R°£ªºShape(59)
²¨¥¤§
§Ú«ç»ò§JªA¹Ï¤ù©Ò¨£ªº¹ê»Ú¶¶§Ç»P¹Ï¤ù¶×¤J¶¶§Çªº®t§O¡A¥H§Q§Ú«áÄò¦b¾Þ§@«ü©w¹Ï¤ù®Éªº§xÂZ¡H |
|
HELLO !!
|
|
|
|
|
- ©«¤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
|
¦^´_ 1# baconbacons
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex_Shapes()
- Dim i As Integer, E As String, S As Shape, Rng As Range
- With ActiveSheet
- .Shapes.SelectAll '¿ï©w Shapeª«¥óªº¶°¦X
- Selection.Delete '§R°£ ©Ò¦³Shapeª«¥ó
- For i = 0 To 9
- E = "http://forum.twbts.com/uc_server/avatar.php?uid=16665&size=middle"
- If i Mod 2 <> 0 Then E = "http://forum.twbts.com/uc_server/avatar.php?uid=16&size=middle"
- With .Range("A1").Offset(i * 6)
- With ActiveSheet.Shapes.AddShape(i + 1, .Left, .Top, .Cells.Resize(, 5).Width, .Cells.Resize(5).Height)
- .Fill.UserPicture E
- End With
- With .Offset(, 10)
- ActiveSheet.Shapes.AddPicture E, True, True, .Left, .Top, .Cells.Resize(, 5).Width, .Cells.Resize(5).Height
- End With
- End With
- Next
-
- '·s¼W«ö¶s
- Set Rng = .Range("A1").Offset(, 7)
- .OLEObjects.Add ClassType:="Forms.CommandButton.1", Link:=False, DisplayAsIcon:=True, Left:=Rng.Left, Top:=Rng.Top, Width:=Rng.Resize(, 2).Width, Height:=Rng.Resize(2).Height
-
- ' ¬¡¶¤¤¦³³]p¤@Ó«ö¶s¡A¦pªGn«ü©w¯S©w¹Ï¤ù®É¡A¤]·|±N¸Ó«ö¶sºâ¦¨¤@ÓShape³y¦¨§xÂZ
- '¬d¬Ý«ö¶s .Type, .Name, .AutoShapeType
- For Each S In ActiveSheet.Shapes
- Debug.Print S.Type, S.Name, S.AutoShapeType
- If S.Type = 12 Then MsgBox S.Name
- Next
- End With
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|