- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# boblovejoyce
y = Cells(9, 1).End(xlDown).Row ¬°¤°»òy±o¨ìªºÈ¤£¬O1553?
Y ªº´Á±æȬO Cells(9, 1) = A9,©¹¤U³Ì«á¤@Ó¦³¸ê®ÆªºÀx¦s®æ
ªþÀɵ{¦¡¤¤ ¬°¦ó¤£¬OA1¦Ó¥ÎA9
¸Õ¸Õ¬Ý ¤u§@ªí¤W¦³¤Ó¦h¤½¦¡·|¦«ºCµ{¦¡¹B¦æ- Option Explicit
- Sub test()
- Dim S As Worksheet, f As Integer, r As String, i As Integer, j As Integer, a() As String, t As Date
- Dim tmpath As String, MyFile As String
- t = Timer
- tmpath = ActiveWorkbook.Path
- MyFile = tmpath & "\" & "Sch_chk.txt" 'Ū¨ú·í«eEXCELÀɮ׸ô®|¤Uªº«ü©wTXT
- i = 1 '±q²Äi¦C¶}©l¼g¤JÀɮ׸ê®Æ,i¥i¦Ûq¨Ì¦Û¤v»Ýn
- Set S = ActiveSheet
- S.Cells.Clear
- f = FreeFile
- Open MyFile For Input As #f
- Do While Not EOF(f)
- Line Input #f, r
- If (InStr(1, r, "CHPT Design Note", vbTextCompare)) = 0 And _
- (InStr(1, r, "_Index_", vbTextCompare)) = 0 Then 'ªÅ®æ_¡A¬O¤@Ó³s±µµü¡A¥Î©ó´«¦æ
- a = Split(r, "!") '¸ÓÀÉ®×¥H!¬°¤À¹j²Å¸¹
- S.Cells(i, "a").Resize(, UBound(a) + 1) = a
- 'For j = 0 To UBound(a)
- ' s.Cells(i, j + 1).Value = a(j) 'Ū¨ú¸ê®Æ¨Ì§Ç¦s¤J²Äi¦Cªº²Ä1Ó¨ìjÓÄæ¦ì
- 'Next j
- i = i + 1
- End If
- Loop
- Close #f
- With S.Range("D1:D" & S.[A1].End(xlDown).Row) 'D1:D"&¨ìAÄæ³Ì«á¤@¦C¸¹ªº½d³ò
- .Cells = "=RC[-2]&RC[-1]"
- ' µ¥¦P¦Û°Ê¶ñº¡ : AutoFill Destination:=Range("D1:D" & x &)
- .Value = .Value
- End With
- 'ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-2],RC[-1])"
- 'ActiveCell.FormulaR1C1 = "=RC[-2]&RC[-1]"
- ' Range("D1").Select
- 'x = Cells(3, 1).End(xlDown).Row
- 'Selection.AutoFill Destination:=Range("D1:D" & x & "") 'Àx¦s®æ¦Û°Ê¶ñº¡
-
- S.Range("A:A,D:D").Copy
- S.Range("H1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
- :=False, Transpose:=False
- 'Range("A:A,D:D").Select
- 'Selection.Copy
- 'Range("H1").Select
- 'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
- :=False, Transpose:=False
- 'Application.CutCopyMode = False
-
- '*****************************
- '2003ª©¨S RemoveDuplicates ³o¤èªk,¥i¥Î¶i¶¥¿z¿ï¤£«½Æªº¸ê®Æ
- ActiveSheet.Range("$H$1:$I$65536").RemoveDuplicates Columns:=2, Header:=xlNo
- '*****************************************
-
- With S.Range("J1:J" & S.[A1].End(xlDown).Row) 'J1:J"&¨ìAÄæ³Ì«á¤@¦C¸¹ªº½d³ò
- .Cells = "=COUNTIF(C[-6],RC[-1])"
- ' µ¥¦P¦Û°Ê¶ñº¡ : AutoFill Destination:=Range("J1:J" & x )
- .Value = .Value
- End With
- 'y = Cells(9, 1).End(xlDown).Row
- 'Range("J1").Select
- 'ActiveCell.FormulaR1C1 = "=COUNTIF(C[-6],RC[-1])"
- 'Selection.AutoFill Destination:=Range("J1:J" & s.[A1].End(xlDown).Row)
- 'Selection.AutoFilter
- '*****2003 ¦Û°Ê¿z½d³ò¿ï,»Ý¬O³sÄò½d³ò****************
- 'ActiveSheet.Range("H:H,J:J").AutoFilter Field:=3, Criteria1:="1"
- '**************************************************
- S.Range("H1").AutoFilter Field:=3, Criteria1:="1"
- 'MsgBox "Ū¨úÀɮ׸ê®Æok"
- MsgBox Format(Timer - t, "0.0000")
- End Sub
½Æ»s¥N½X |
|