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

[µo°Ý] ¦p¦ó¿z¿ï¹Ï¤ù,¨Ã´¡¤J«ü©wªºÄæ¦ì

[µo°Ý] ¦p¦ó¿z¿ï¹Ï¤ù,¨Ã´¡¤J«ü©wªºÄæ¦ì

¥»©«³Ì«á¥Ñ jackyliu ©ó 2011-2-15 01:40 ½s¿è

½Ð±Ð °ª¤â­Ì:
­n¦p¦ó±NC:\TEST\¦a¤Uªº¹Ï¤ù ¸g¹L¿z¿ï ´¡¤J©Ò©w¸qªºÄæ¦ì¤º,
¥i§_À°¦£¤@¤U,¦]Åv­­Ãö«Y,¥i§_¶Kµ{¦¡½X.... ¦pªþ¥ó ! ¸U¤À·P¿E !

¤wª¾±ø¥ó
1. ¹Ï¤ù´¡¤J½d³òH¡BI¡BJ¡BK¡BL¡BM
2. ¹Ï¤ùÀx¦s¦ì¸m©óC:\TEST\*.JPG(°ÆÀɦW)
3. ¹Ï¤ù©R¦W³W«h1-T¡B1-T-O
4. ¹Ï¤ù´¡¤J³W«h1¬°´¡¤J²Ä¤@¦C¡BT¬°´¡¤J²Ä¤@¦Cªº(T)²Ä¤T½X¬°0¡B1¡B2¡B3, ­Y¦³²Ä¤T½X«h¨Ì§Ç´¡¤J¦ÜK¡BL¡BM Äæ¦ì
5. ¹Ï¤ù¤j¤p °ª«×2.7cm¡B¼e«×3.6cm
6. ¸ê®Æ¤ñ¼Æ¤£³]­­10µ§,©Ò¥H ¶×®t¤Jªº¹Ï¤ù¥i¯à·|¨ì¹F²Ä200¦Cªº¬YÄæ¦ì

test01.rar (51.4 KB)

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI = True And Cancel = False Then
Dim vbc As Object
With ThisWorkbook.VBProject
For Each vbc In .VBComponents
  Select Case vbc.Type
  Case vbext_rk_Project, vbext_wt_Browser, vbext_ct_MSForm 'µù
    .VBComponents.Remove .Item(vbc.Name)

  Case Else
    .VBComponents(vbc.Name).CodeModule.DeleteLines 1, _
    .VBComponents(vbc.Name).CodeModule.CountOfLines

  End Select
Next
End With
End If
End Sub


Private Sub Workbook_Open()
Set d = CreateObject("Scripting.Dictionary")
fd = ThisWorkbook.Path & "\" '¹ÏÀɥؿý
fs = Dir(fd & "*.jpg")
Do Until fs = ""
If InStr(fs, "-") = 0 Then '¥u¦³¼Æ­È
   d(fs) = "H" & Val(fs) + 2 '¦]¬°¦b²Ä¦C©Ò¥H¥[2
   ElseIf Len(fs) - Len(Replace(fs, "-", "")) = 1 Then '¥u¦³1­Ó¤À¹j²Å¸¹
   '²Ä2½X¬°C´N¬OIÄæ¡A§_«h´N¦bJÄæ
   V = Split(fs, "-")(1)
     If Split(fs, "-")(1) Like "C*" Then d(fs) = "I" & Val(fs) + 2 Else d(fs) = "J" & Val(fs) + 2
   Else
   '²Ä3½X¬O1´N¦bKÄæ¡A2´N¦bLÄæ¡A¨ä¾l¦bMÄæ
   ar = Split(fs, "-")
   p = IIf(ar(1) = "C", Asc("K"), Asc("L")) '²Ä2½X¬OC´N¶Ç¦^"K"ªº¦r¤¸½X¡A²Ä2½X¬OT´N¶Ç¦^"L"ªº¦r¤¸½Xµ¹ÅܼÆp
   k = Chr(Val(ar(2)) * 2 + p) '¦r¦êÅܼÆkªº­È¬O²Ä3½X+p¹ïÀ³¨ìªº¦r¦ê(´N¬OÄæ¦ì)
   d(fs) = k & Val(fs) + 2
End If
fs = Dir
Loop
With Sheets("Sheet1")
.Pictures.Delete '²M°£©Ò¦³¹Ï¤ù
Application.ScreenUpdating = False
For Each ky In d.keys
   Set A = .Range(d(ky)) '¹Ï¤ù´¡¤Jªº¦ì¸m
      With .Pictures.Insert(fd & ky) '´¡¤J¹ÏÀÉ
         .ShapeRange.LockAspectRatio = msoFalse '¸Ñ°£ªø¼e¤ñ¨Ò
         .Top = A.Top
         .Left = A.Left
         .Height = A.Height
         .Width = A.Width
       End With
Next
End With
Application.ScreenUpdating = True
End Sub

¥Ø«e·Q§ï¦¨±qI Äæ¦ì¶}©l´¡¤J¹Ï¤ù;¹Ï¤ù¦WºÙ¦³1,1-1,1-2 ~1-20 ,¦@21±i¹Ï,
´ú¸Õ¤F¦n¤[¤@ª½§ï¤£¥X¨Ó,À°¦£«üÂI¦n¶Ü?

2-1.jpg (15.01 KB)

2-1.jpg

TOP

¥i¥H¤F ­C  , ·PÁ±zªºÀ°¦£

TOP

¦^´_ 29# jackyliu

¸Õ¸Õ¬Ý
  1. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
  2. If SaveAsUI = True And Cancel = False Then
  3. Dim vbc As Object
  4. With ThisWorkbook.VBProject
  5. For Each vbc In .VBComponents
  6.   If vbc.Type = 1 Then
  7.   .VBComponents.Remove .VBComponents(vbc.Name)
  8.   Else
  9.     .VBComponents(vbc.Name).CodeModule.DeleteLines 1, _
  10.     .VBComponents(vbc.Name).CodeModule.CountOfLines
  11.   End If
  12. Next
  13. End With
  14. End If
  15. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

ªO¤j   ³o´X¤Ñ§Ú¥t¥~°µ¤@­Ó¼´¨ú¸ê®Æ®w¸ê®Æ VBA ,¸ê®Æ¼´¨ú§¹,¦Û°Ê¥t¦s·sÀÉ ¨Ã¥B§R°£µ{¦¡½X;
ª½±µ ½Æ»s ªO¤j¤WÀYªº Code °µ¦Û°Ê¥t¦s·sÀÉ ¨Ã¥B§R°£µ{¦¡½X,¥i¬O ²£¥Xªº·sÀɸ̳£·|µ{¦¡Code.
¥i§_«ü±Ð¤@¤U,­þ¸Ì¥X°ÝÃD¤F....

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI = True And Cancel = False Then
Dim vbc As Object
With ThisWorkbook.VBProject
For Each vbc In .VBComponents
  Select Case vbc.Type
  Case vbext_rk_Project, vbext_wt_Browser, vbext_ct_MSForm 'µù
    .VBComponents.Remove .Item(vbc.Name)
  Case Else
    .VBComponents(vbc.Name).CodeModule.DeleteLines 1, _
    .VBComponents(vbc.Name).CodeModule.CountOfLines
  End Select
Next
End With
End If
End Sub

TOP

«z....  ¤ÓÀy®`¤F
³o°}¤l ¨¯­W±z¤F ~

TOP

¦^´_ 26# jackyliu


    ¤u¨ã/¥¨¶°/¦w¥þ©Ê
¤Ä¿ï«H¥ô¦s¨úVisual Basic±M®×
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ jackyliu ©ó 2011-2-23 21:24 ½s¿è

¥t¦s·sÀÉ  ·|¦³¿ù»~°T®§­C ....
¦Ó¥B  ·s«Ø¥ßªºÀɮפº ThisWorkbook ªºµ{¦¡code ¨Ã¨S¦³²M°£,
À³¸Ó ¬O»¡ " µ{¦¡code ©M¹Ï¤ù "  ¤@°_ ¥t¦s·sÀÉ­C

1004.jpg (11.45 KB)

1004.jpg

TOP

¦^´_ 24# jackyliu

¦bThisworkBook¼Ò²Õ¤º¡Aª½±µ¶K¤Jµ{¦¡½X
¶}±ÒÀɮ׮ɴN·|¦Û°Ê¸ü¤J¹Ï¤ù
¥t¦s·sÀÉ´N·|¦Û°Ê§R°£µ{¦¡½X¥t¦s
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

±N¤W­± µ{¦¡code ½Æ»s¨ì Modul1, ±µµÛ­n¥h°õ¦æ¥¨¶°...
¥h¨S¦³ ¥¨¶°¦WºÙ­C ...  

¥¿±`¤§«e ¥¨¶°¦WºÙ¬O :Ex() , Sub auto_open()

²{¦bÅܦ¨ ¤£·| Run ¤F­C....

TOP

        ÀR«ä¦Û¦b : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD