- ©«¤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
        
|
¦^´_ 5# av8d - Dim d As Object
- Private Sub UserForm_Initialize()
- Dim A As Range
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("Sheet1")
- .Activate
- For Each A In .Range("I3", .[i3].End(xlDown))
- d(A.Value) = IIf(d(A.Value) = "", A.Offset(, 1).Value, d(A.Value) & "," & A.Offset(, 1))
- Next
- ComboBox1.List = d.keys
- End With
- ¨®¸¹¤u§@ªí¼Æ
- End Sub
- Private Sub ComboBox1_Change() ' ´_ì¿z¿ï
- ActiveSheet.AutoFilterMode = False
- End Sub
- Private Sub CommandButton1_Click() ' ´_ì¿z¿ï
- ctiveSheet.AutoFilterMode = False
- End Sub
- Private Sub CommandButton2_Click()
- Call Ex
- ¨®¸¹¤u§@ªí¼Æ
- End Sub
- Private Sub ¨®¸¹¤u§@ªí¼Æ()
- TextBox1 = Sheets.Count - 1
- End Sub
½Æ»s¥N½X- Option Explicit
- Sub Ex()
- Dim Car_No As String, xlRow As Long, E As Range, Rng As Range
- With Sheet1
- .Activate
- .AutoFilterMode = False
- Car_No = UserForm1.ComboBox1
- .Rows(2).Cells(1).AutoFilter Field:=9, Criteria1:=UCase(Car_No)
- xlRow = .Rows(2).Cells(9).End(xlDown).Row
- If xlRow <> Rows.Count Then
- Set Rng = .Cells.SpecialCells(xlCellTypeVisible)
- Else
- MsgBox "§ä¤£¨ì ¨®¸¹ !! " & Car_No: Exit Sub
- End If
- '**********
- On Error Resume Next '±Ò°Êªº¿ù»~³B²zµ{¦¡: ¦³¿ù»~Ä~Äò¤U¤@¦æµ{¦¡½X
- Sheets(Car_No).Activate '¨S¦³¨®¸¹¤u§@ªí·|¦³¿ù»~
- If Err.Number <> 0 Then 'µ{¦¡¦³¿ù»~
- Sheets.Add , Sheets("sheet1") '·s¼W¤u§@ªí
- '***®ø°£ ¦³¿ù»~Ä~Äò¤U¤@¦æµ{¦¡½Xªº«ü¥O***
- On Error GoTo 0 '°±¤î²{¦bµ{§ÇùØ¥ô¦ó¤w±Ò°Êªº¿ù»~³B²zµ{¦¡¡C
- End If
- '**********************
- With ActiveSheet
- .Cells.Clear
- Rng.Copy .[a1]
- Application.CutCopyMode = False
- .Name = .[i3]
- .Cells(.Rows.Count, "O").End(xlUp).Offset(1, -1) = "¦Xp"
- .Cells(.Rows.Count, "O").End(xlUp).Offset(1) = Application.Sum(.Range("O:O")) 'ª÷ÃB¥[Á`
- End With
-
- '--*** ¬O§_¥i¥H¤£²¾°£©Î²¾°£3µ§---
- If UserForm1.OptionButton1 Then '***ªí³æ·s¼W OptionButton1 ±±¨î¶µ .Value=True
- For Each E In Rng.SpecialCells(xlCellTypeVisible).SpecialCells(xlCellTypeConstants).EntireRow
- If E.Row > 2 Then E.Delete
- Next
- End If
- '-- ****************
- .AutoFilterMode = False
- .Activate
- End With
- End Sub
½Æ»s¥N½X ¦^´_ 6# c_c_lai
.Cells.SpecialCells(xlCellTypeVisible).SpecialCells(xlCellTypeConstants).Offset(2).Delete xlUp
¬O¦³¿ù»~ªº¤w×¥¿ ¸Õ¸Õ¬Ý |
|