- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 256
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-26
|
¦^´_ 22# jackyliu
thisworkbook¼Ò²Õ- 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
½Æ»s¥N½X |
|