- ©«¤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
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-3-23 11:17 ½s¿è
¦^´_ 5# hugh0620
Data¶×¾ã ªº¤u§@ªí§Ç¸¹¤£³sÄò 18,19,21,22 ¯Ê 20
§ï¬° Sheet2.Cells(2 + N, 1).Text
For N = 1 To A
'Sheets.Add AFTER:=Worksheets(N + 1) '·s¼Wsheet
Sheets(Sheet2.Cells(2 + N, 1).Text).Activate '''
Sheets(Sheet2.Cells(2 + N, 1).Text).Cells.Clear
קï§Aªºµ{¦¡¦p¤U- Private Sub CommandButton1_Click()
- Dim N As Integer, E
- CommandButton2_Click
- With Sheets("Data¶×¾ã")
- Sheets("ì©lData").Range("A2").CurrentRegion.Copy .Range("B2")
- '=====±Æ§Ç====
- .Range("B3").End(xlToRight).End(xlDown).Sort Key1:=.Range("B3"), _
- Order1:=xlAscending, Key2:=.Range("C3"), Order2:=xlAscending, Key3:=.Range("E3"), Order3:=xlAscending, Header:=xlYes
- '=====±Æ§Ç====
- '=====¶i¶¥¿z¿ï====
- ' .Range("B2").Select
- ' Range(Selection, Selection.End(xlDown)).Select
- .Range("B2:B256").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=.Range( _
- "A2"), Unique:=True
- '=====¶i¶¥¿z¿ï====
- End With
- On Error GoTo Sheet_Add '¦³¿ù»~¨ì ¦æ¸¹ Sheet_Add
- A = Application.CountA(Sheet2.[A3:A65536]) 'A²Îp¥X»Ýn¶]´XÓSheet
- For N = 1 To A
- Sheets(Sheet2.Cells(2 + N, 1).Text).Select
- With ActiveSheet
- .Cells.Clear '''
- .Range("A1") = Sheets("Data¶×¾ã").Range("B2")
- .Range("B1") = Sheets("Data¶×¾ã").Cells(2 + N, 1)
- .Range("B2") = Sheets("Data¶×¾ã").Range("E2")
- For Each E In Array(1, 97, 193)
- With .Cells(Rows.Count, 1).End(xlUp).Offset(1)
- .Cells(1) = "POINT_1"
- .Cells(2) = "POINT_2"
- .Cells.Resize(2).AutoFill .Cells.Resize(96)
- .Cells(1, 2).Resize(96) = E
- End With
- Next
- End With
- Do Until Sheet2.Cells(3 + H, 2) = ""
- If Sheet2.Cells(3 + H, 2) = Sheet2.Cells(2 + N, 1) Then
- If ActiveSheet.Cells(2, 2 + Z) = Sheet2.Cells(3 + H, 3) Then
- Select Case Sheet2.Cells(3 + H, 5)
- Case 1
- For X = 1 To 96
- ActiveSheet.Cells(2 + X, 2 + Z) = Sheet2.Cells(3 + H, 5 + X)
- Next
- Case 97
- For X = 1 To 96
- ActiveSheet.Cells(98 + X, 2 + Z) = Sheet2.Cells(3 + H, 5 + X)
- Next
- Case 193
- For X = 1 To 96
- ActiveSheet.Cells(194 + X, 2 + Z) = Sheet2.Cells(3 + H, 5 + X)
- Next
- End Select
- Else
- Z = Z + 1
- ActiveSheet.Cells(2, 2 + Z) = Sheet2.Cells(3 + H, 3)
- Select Case Sheet2.Cells(3 + H, 5)
- Case 1
- For X = 1 To 96
- ActiveSheet.Cells(2 + X, 2 + Z) = Sheet2.Cells(3 + H, 5 + X)
- Next
- Case 97
- For X = 1 To 96
- ActiveSheet.Cells(98 + X, 2 + Z) = Sheet2.Cells(3 + H, 5 + X)
- Next
- Case 193
- For X = 1 To 96
- ActiveSheet.Cells(194 + X, 2 + Z) = Sheet2.Cells(3 + H, 5 + X)
- Next
- End Select
- End If
- End If
- H = H + 1
- Loop
- H = 0
- Z = 0
- 'ActiveSheet.Rows ("2:2")
- 'Selection.NumberFormatLocal = "yyyy/m/d"
- ActiveSheet.Rows("2:2").NumberFormatLocal = "yyyy/m/d"
- Next
- Exit Sub
- Sheet_Add: '¦æ¸¹
- If Err <> 9 Then
- MsgBox "¿ù»~È " & Err & " ½ÐÀˬd¿ù»~ !!!"
- Exit Sub
- End If
- With Sheets.Add(AFTER:=Worksheets(N + 1)) '·s¼Wsheet
- .Name = Sheet2.Cells(2 + N, 1) '¼ÐÅÒ¦WºÙ
- End With
- Resume Next 'ªð¦^¿ù»~³B
- End Sub
½Æ»s¥N½X |
|