- ©«¤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 ©ó 2012-2-27 20:57 ½s¿è
¦^´_ 1# spiritwing - Option Explicit
- Sub Ex()
- Dim xPath As String, xFile As String, Sp As Integer, Cz As Integer, G As Long, K As Integer, Mh As Integer
- Dim ii As Integer
- xPath = "D:\¬Û¤ù\89¦~\" '¹Ï¤ùªº¸ê®Æ§¨
- 'Dir ¨ç¼Æ ¶Ç¦^¤@Ó String ¡A¥Î¥Hªí¥Ü¦X¥G±ø¥ó¡BÀÉ®×ÄÝ©Ê¡BºÏºÐ¼Ð°Oªº¤@ÓÀɮצWºÙ¡B©Î¥Ø¿ý¡BÀɮק¨¦WºÙ¡C
- xFile = Dir(xPath & "*.jpg") '¹Ï¤ùªº°ÆÀɦW ¬°jpg
- 'xFile = Dir(xPath & "*.*") '¹Ï¤ùªº¸ê®Æ§¨ ³£¬O¹Ï¤ùÀÉ
- With ActiveSheet '§@¥Î¤¤ªº¤u§@ªí
- Sp = 35 '¤ô¥
- Cz = 160 '««ª½
- G = 0.1 '°ª
- K = 170 '¼e
- Mh = 4 '¨C¦æ
- .Pictures.Delete '§R°£ ©Ò¦³¹Ï¤ù
- .[a:a] = "" '²M°£ AÄæ¸ê®Æ
- ii = 1 '³]©w¬°1
- Application.ScreenUpdating = False
- Do
- .Cells(ii, 1).Select '¿ï¾ÜAÄæ ªº²Ä ii Àx¦s®æ(ActiveCell :§@¥Î¤¤ªºÀx¦s®æ)
- .Cells(ii, 1) = xFile '¼g¤WÀɦW
- With .Pictures.Insert(xPath & xFile) '´¡¤J¹Ï¤ù
- .Left = ActiveCell.Offset(, 2).Left '´¡¤J¹Ï¤ùªº¥ªºÝ¦ì¸m¬O: ActiveCell ¥k²¾2Ä檺¥ªºÝ
- .Top = ActiveCell.Offset(, 2).Top '´¡¤J¹Ï¤ùªº¤WºÝ¦ì¸m¬O: ActiveCell ¥k²¾2Ä檺¤WºÝ
- .Width = 190 '³]©w ´¡¤J¹Ï¤ùªº ¼e«×
- .Height = 143 '³]©w ´¡¤J¹Ï¤ùªº °ª«×
- ActiveCell.Offset(, 2).ColumnWidth =33 '³]©w´¡¤J¹Ï¤ù©Ò¦bÀx¦s®æ ªº¼e
- ActiveCell.Offset(, 2).RowHeight = .Height '³]©w´¡¤J¹Ï¤ù©Ò¦bÀx¦s®æ ªº°ª
- End With
- xFile = Dir 'Ä~Äò´M§ä¤U¤@ÓÀÉ®×
- ii = ii + 1 'AÄæ ªº²Ä ii Àx¦s®æ©¹¤U¤@¦C
- Loop Until xFile = "" 'Â÷¶} Do °j°éªº±ø¥ó¬O: §ä¤£¨ì ÀÉ®×
- .[A1].Select
- Selection.EntireColumn.AutoFit 'AutoFit ¤èªk ±N½d³ò¤¤ªºÄæ¼e©M¦C°ª½Õ¾ã¬°³Ì¾A·íªºÈ
- Application.ScreenUpdating = True 'ScreenUpdating ÄÝ©Ê ©w¦pªG¿Ã¹õ§ó·s¥\¯à¬O¶}±Òªº«h¬° True¡CŪ/¼g Boolean
- End With
- End Sub
½Æ»s¥N½X |
|