¦p¦ó©óexcelªº³ø»ùªí³æ¤W¿é¤J¤£¦PªºItem±a¤J¤£¦Pªº¹Ï¤ù
- ©«¤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# kimie0_0
¾A¥Î©ó§A1#ªºÀÉ®×- Sub Ex_AutoAddPic()
- Dim Rng(1 To 2) As Range, Rng_First As String, MyPcName As String, Picture_Path As String
- Picture_Path = "D:\photo\"
- With ActiveSheet
- For Each Shp In .Shapes
- If Shp.Type = msoPicture Then Shp.Delete
- Next
- Set Rng(1) = .Cells.Find("Item no:", lookat:=xlWhole, SearchOrder:=xlByRows) 'xlByRows(´`¦C)©Î xlByColumns(´`Äæ) ·j´M
- If Not Rng(1) Is Nothing Then
- Rng_First = Rng(1).Address '²Ä¤@Ó´M§ä¨ì "Item no:" ªº¦ì¸m
- Do
- MyPcName = Picture_Path & Rng(1).Cells(1, 2) & ".jpg"
- If Dir(MyPcName, vbDirectory) <> "" Then
- Set Rng(2) = Rng(1).Cells(-7) '¤W²¾8¦CªºCells¦ì¸m
- With .Pictures.Insert(MyPcName)
- .Top = Rng(2).Top '´¡¤J¹Ï¤ùªº³»ÂI,¦ì©ó¤u§@ªí±q²Ä¤@¦C³»ºÝ¦Ü¸Ó½d³ò³»ºÝªº¶ZÂ÷
- .Left = Rng(2).Left '´¡¤J¹Ï¤ùªº¥ªÃä,¦ì©ó¤u§@ªí±q A Ä楪¦Ü¸Ó½d³ò¥ªªº¶ZÂ÷
- .Height = Rng(2).Resize(8).Height '´¡¤J¹Ï¤ùªº½d³òªº°ª«×
- .Width = Rng(2).Resize(, 2).Width '´¡¤J¹Ï¤ùªº½d³òªº¼e«×
- End With
- End If
- Set Rng(1) = .Cells.FindNext(Rng(1)) '¤U¤@Ón´M§äªº¦r¦ê
- Loop Until Rng_First = Rng(1).Address '¦^¨ì²Ä¤@Ó´M§ä¨ì "Item no:" ªº¦ì¸m
- End If
- End With
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|