- ©«¤l
- 2833
- ¥DÃD
- 10
- ºëµØ
- 0
- ¿n¤À
- 2889
- ÂI¦W
- 0
- §@·~¨t²Î
- ¡e²¤¡f
- ³nÅ骩¥»
- ¡e²¤¡f
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¡e²¤¡f
- µù¥U®É¶¡
- 2013-5-13
- ³Ì«áµn¿ý
- 2024-11-17
|
¥»©«³Ì«á¥Ñ ã´£³¡ªL ©ó 2015-9-24 11:45 ½s¿è
¦b¡e¿é¤Jªí¡f¿é¤J§¹¦¨«á¡A¦A¬£¥Xµ²ªG¦Ü¡e³øªí¡f¡A
°µ¤F´XÓ¨¾§b¡A°Ñ¦Ò¬Ý¬Ý¡G- Sub ¬£¥Xµ²ªG()
- Dim Arr, A, T$, xD, DT As Range
- Set DT = [H22]
- Set xD = CreateObject("Scripting.Dictionary")
- Arr = Range([Database!B2], [Database!B65536].End(xlUp)(2))
- For Each A In Arr
- ¡@¡@T = Right(A, 7): If T Like "#######" Then xD(T) = 1
- Next
- If xD.Count = 0 Then MsgBox "DatabaseµL¸ê®Æ¥i§@·~¡I": Exit Sub
- ¡@
- Dim FL$, xB As Workbook, xS As Worksheet, R&
- FL = ThisWorkbook.Path & "\½d¨Ò³øªí.xls"
- If Dir(FL) = "" Then MsgBox "§ä¤£¨ì³øªíÀÉ¡I": Exit Sub
- If CheckBookOpen(FL) > 0 Then
- ¡@¡@MsgBox "³øªíÀÉ¥¿³Q¶}±Ò¤¤¡A¬°ÁקK¿ù»~¡A½Ð¥ýÃö³¬¡I": Exit Sub
- End If
- ¡@
- Set xB = Workbooks.Open(FL)
- With xB.Sheets(1)
- ¡@¡@R = .[B65536].End(xlUp).Row
- ¡@¡@If R < 7 Then MsgBox "³øªíµL MONBR ¸ê®Æ¡I": Exit Sub
- ¡@¡@Arr = .Range("B7:B" & R)
- ¡@¡@For i = 1 To UBound(Arr)
- ¡@¡@¡@¡@T = Right(Arr(i, 1), 7): Arr(i, 1) = ""
- ¡@¡@¡@¡@If xD(T) = 1 Then Arr(i, 1) = "V"
- ¡@¡@Next i
- ¡@¡@With .Range("N7:N" & R): .Value = Arr: .Select: End With
- End With
- ¡@
- DT(2) = DT: DT = Now
- MsgBox "¬£¥Xµ²ªG¦Ü³øªí¤w§¹¦¨¡A½T©wµL»~«áÀx¦s¦AÃö³¬ÀɮסI":
- End Sub
- ¡@
- '¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×
- Private Function CheckBookOpen(BookName$) As Long¡@'°Æµ{¦¡-ÀˬdÀɮ׬O§_¶}±Ò¤¤
- On Error Resume Next
- Open BookName For Binary Access Write Lock Write As #1
- Close #1
- CheckBookOpen = Err.Number
- On Error GoTo 0
- End Function
½Æ»s¥N½X ªþ¥ó¤U¸ü¡G
³øªív01.rar (381.29 KB)
|
|