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

[µo°Ý] excel VBA¦Û°Ê±a¤J¹Ï¤ù

[µo°Ý] excel VBA¦Û°Ê±a¤J¹Ï¤ù

¦U¦ì¦n
¥Ø«e¤p§Ì¸I¨ì¤@­Ó°ÝÃD
´N¬O§Úªº¸ê®Æ§¨¤º³£·|¦³³sÄòªº§å¸¹
ex:A00001,A00002,A00003,...
¸Ì­±ªº¹Ï¤ù¤]¬O³£¬O³sÄòªº
ex:001-1,001-2,002-1,002-2,.....
¥Ø«e¦³ª¦¤å¥i¥HÅý¤@­Ó¸ê®Æ§¨±a¤J¹Ï¤ù
¥i¬O¨S¦³¿ìªk·j´M¤U¤@­Ó¸ê®Æ§¨
Åܦ¨§Ú­n±a¤J¤U¤@­Óªº®É­Ô­n¥h§ïVBA
³o¼Ë·Pı«ÜºC
¥H¤Î»¡¦]¬°¦³¨Ç¸ê®Æ§¨¤ºªºÀÉ®×·|¸õ¸¹,¦ý¬OÀɦW¤@¼Ë
¤£ª¾¹D¯à¤£¯à³]©w¦b±a¤J¹Ï¤ù«á¥i¥H°Ñ·Ó²Ä¤@¦C
­Y¦³²Ä¤@¦C(¤w¤â°Ê¥´¤W¥hªº¦W¦r)¤~±a¤J¹ïÀ³¹Ï¤ù

ªþ¤W§Úª¦¤å«áªºµ{¦¡½X
ÁÂÁ¦U¦ì

Sub PHOTO()
ActiveSheet.Columns("C") = ""
Set Sh = ActiveSheet
With Sh
    .Pictures.Delete
End With
fs = Dir("G:\picture\A00001\*.jpg")
Do Until fs = ""
   R = R + 1
   Cells(1, R + 1) = fs
   Cells(2, R + 1).Select
   ActiveSheet.Pictures.Insert("G:\picture\A00001\" & Cells(1, R + 1)).Select
   With Selection
       .Top = ActiveSheet.Cells(2, R + 1).Top + 1
       .Left = ActiveSheet.Cells(2, R + 1).Left + 1
       .Width = ActiveSheet.Cells(2, R + 1).Width - 1
       .Height = ActiveSheet.Cells(2, R + 1).Height - 1
   End With
   fs = Dir
Loop
End Sub

§A©Ò»¡©úªº¸ê®Æ§¨µ²ºc¤£¤Ó©ú½T¡A¤ñ¦p¡G
¦b"G:\picture\"¸ê®Æ§¨¤¤¦³A00001,A00002,A00003...¸ê®Æ§¨¡AA00001¤Uªº¤å¥ó³Q©R¦W¬°001-1.JPG,001-2.JPG.....A00002¤Uªº¤å¥ó³Q©R¦W¬°002-1.JPG,002-2.JPG.....³o¼Ë¤l»ò¡H
©Î¬Oª½±µ¥u¦b"G:\picture\"¸ê®Æ§¨¸Ì·j´MA¦C¤¤ªº¤å¥ó¦W¡A¦pªG¤å¥ó¦s¦b«h±N¹Ï¤ù¾É¤JSheet?¨º»òA¦C¤¤ªº¤å¥ó¦W¬O¥H"G:\picture\A00001\001-1.JPG"¤è¦¡¡AÁÙ¬O"001-1.JPG"¤è¦¡¡A©Î¬O"001-1"¤è¦¡¡H
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥h­þ¡H

TOP

        ÀR«ä¦Û¦b : °ß¨ä´L­«¦Û¤vªº¤H¡A¤~§ó«i©óÁY¤p¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD