- ©«¤l
- 559
- ¥DÃD
- 58
- ºëµØ
- 0
- ¿n¤À
- 626
- ÂI¦W
- 0
- §@·~¨t²Î
- win8
- ³nÅ骩¥»
- office2013
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- TW
- µù¥U®É¶¡
- 2010-11-22
- ³Ì«áµn¿ý
- 2024-6-14
|
¥»©«³Ì«á¥Ñ hugh0620 ©ó 2011-10-21 11:57 ½s¿è
¦^´_ 5# Helain
¼Ó¥Dªº°ÝÃD~ §Ú¥H«e¤]¦³°Ý¹L~
Ó¤H¶K©«ªº³sµ²ÂI¸ê®Æ¦ç±ø¥ó ¤ÀSHEET
´£¨Ñ¤@Óª©¤j̪º³B²z¤âªk~ ¦Û¤v¦AºI¨ú©Ò»Ýnªº³¡¥÷~ ¨Ó§¹¦¨ªºÀÉ®×~
Data_VBA§¹¦¨ª©_1.rar (103.16 KB)
- Private Sub CommandButton1_Click()
- Macro5 '½Æ»s¶K¤WData¶×¾ã
- '=====±Æ§Ç====
- 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¿ï====
- Dim N As Integer
- A = Application.CountA(Sheet2.[A3:A65536]) 'A²Îp¥X»Ýn¶]´XÓSheet
- For N = 1 To A
- Sheets.Add AFTER:=Worksheets(N + 1) '·s¼Wsheet
- ActiveSheet.Range("A1") = Sheet2.Range("B2")
- ActiveSheet.Range("B1") = Sheet2.Cells(2 + N, 1)
- ActiveSheet.Range("B2") = Sheet2.Range("E2")
-
- For K = 1 To 96
- ActiveSheet.Cells(3 + Y, 1) = "POINT_" & K
- ActiveSheet.Cells(3 + Y, 2) = 1
- Y = Y + 1
- Next
- For K = 1 To 96
- ActiveSheet.Cells(3 + Y, 1) = "POINT_" & K
- ActiveSheet.Cells(3 + Y, 2) = 97
- Y = Y + 1
- Next
- For K = 1 To 96
- ActiveSheet.Cells(3 + Y, 1) = "POINT_" & K
- ActiveSheet.Cells(3 + Y, 2) = 193
- Y = Y + 1
- Next
- Y = 0
- ActiveSheet.Name = Sheet2.Cells(2 + N, 1) 'Sheet2.Range("B2") & Sheet2.Cells(2 + N, 1) '¼ÐÅÒ¦WºÙ ¶È¼Ð¤W¼Æ¦r,Y¦³»Ýn½Ð§â=«á±§ï¦^Sheet2.Range("B2") & Sheet2.Cells(2 + N, 1)
-
- 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").Select
- Selection.NumberFormatLocal = "yyyy/m/d"
- Next
- End Sub
½Æ»s¥N½X |
|