大大們,新年快樂,
請教一個修改程式問題, 下列程式是個篩選檔,是把工作表1資料篩選到工作表2,現時我想把篩選資料貼回工作表1aa欄位開始, 該如何修改, 請大大協助, 謝謝!!
Private Rng
Private Sub ComboBox1_Change()
[IU1] = Rng(2)
[IU2] = "*" & ComboBox1 & "*"
If ComboBox1 = "" Then [IU2] = "<>"
End Sub
Private Sub ComboBox2_Change()
If ComboBox2 = "" Then
[IV1] = Rng(3)
[IV2] = "<>"
Else
[IV1] = Rng(3) & "A"
[IV2] = "=YEAR(" & Rng(3) & ")=" & ComboBox2
End If
End Sub
Private Sub CommandButton1_Click()
Range("A4").CurrentRegion = ""
Rng.AdvancedFilter xlFilterCopy, [IU1:IU2], [A4]
End Sub
Private Sub CommandButton2_Click()
Range("A4").CurrentRegion = ""
Rng.AdvancedFilter xlFilterCopy, [IV1:IV2], [A4]
End Sub
Private Sub Worksheet_Activate()
Dim AA As String, MA, MI
Set Rng = Sheet2.Range("A2").CurrentRegion
ComboBox1.List = Rng.Columns(2).Offset(1).Value
AA = Rng.Columns(3).Offset(1).Address
MA = Format(Application.Max(Sheet2.Range(AA)), "YYYY")
MI = Format(Application.Min(Sheet2.Range(AA)), "YYYY")
ComboBox2.Clear
For I = MI To MA
ComboBox2.AddItem I
Next
End Sub作者: kimbal 時間: 2012-1-25 19:11