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

[µo°Ý] §PÂ_¸ê®Æ§¨¤º¬O§_¦³ÀÉ®×

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-12-5 11:17 ½s¿è

¦^´_ 1# a703130
  1. Option Explicit
  2. Sub Ex() '§PÂ_¸ê®Æ§¨¤º¬O§_¦³ÀÉ®×
  3.     'Dir("D:\test\*.PNG") = "" ¬°¸ê®Æ§¨¤¤ÀɮרS¦³°ÆÀɦW¬OPNGªºÀÉ®×
  4.     '§PÂ_¸ê®Æ§¨¤¤Àɮ׬O§_¦³ÃöÁä¦r ".PNG & .JPG"
  5.     If Dir("D:\test\*.PNG") = "" And Dir("D:\test\*.JPG") = "" Then MsgBox "¸ê®Æ§¨¤¤¨S¦³ .PNG  .JPG"
  6. End Sub
½Æ»s¥N½X
¾ã²z¤@¤U§Aªºµ{¦¡½X
  1. Option Explicit
  2. Sub InsertImage(ImagePath, FolderName)
  3.     Dim ReadRow As Integer, ImageName As String
  4.     Sheets("a").Select
  5.     ReadRow = 24
  6.     '§PÂ_Safety­¶­±²Ä¤@Äæ¬O§_¦³»Ý­n¸ü¤J¹ÏÀɪ½¦Ü¥X²{"END"¦r¼Ë
  7.     Do Until UCase(Cells(ReadRow, 1)) = "END"
  8.         'ImageName = Cells(ReadRow, 1)
  9.         ImageName = ImagePath & "\" & FolderName & "\" & Cells(ReadRow, 1)
  10.         If InStr(ImageName, ".PNG") Or InStr(ImageName, ".JPG") Then
  11.             If Dir(ImageName) <> "" Then
  12.                 Cells(ReadRow, 2).Select
  13.                 ActiveSheet.Pictures.Insert(ImageName).Select
  14.                 Call ImageSize
  15.             End If
  16.         End If
  17.         ReadRow = ReadRow + 1
  18.     Loop
  19. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ºw¤ô¦¨ªe¡C²É¦Ì¦¨ÅÚ¡A¤Å»´¤vÆF¡A¤Å¥Hµ½¤p¦Ó¤£¬°¡C
ªð¦^¦Cªí ¤W¤@¥DÃD