- ©«¤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 ©ó 2014-2-2 09:45 ½s¿è
¦^´_ 14# b7307024
Â\©ñ¸ê®Æ¤u§@ªí¼Ò²Õªºµ{¦¡½X- Option Explicit '¦b¼Ò²Õ¼h¦¸¤¤±j¢¨CÓ¦b¼Ò²ÕùتºÅܼƳ£¥²¶·©ú½Tªº«Å§i¡C
- Option Base 1 '¦b¼Ò²Õ¼h¦¸¤¤¥Î¨Ó«Å§i°}¦C¯Á¤Þªº¹w³]¤U->¬° 1
- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Address = "$B$1" Then
- Ext_data Target
- End If
- End Sub
- Private Sub Ext_data(ByVal Target As Range)
- Dim mnth As Worksheet, all_month(), Rng As Range, AR(), R As Range, S As Integer
- S = 1
- Application.ScreenUpdating = False
- Set Rng = Target.Parent.Range("A5")
- Rng.CurrentRegion.Offset(1).Clear
- all_month = Array("Jan", "Feb", "Mar")
- For Each mnth In Sheets(all_month)
- With mnth
- .Range("A1").AutoFilter 4, "*" & Target & "*" '¦Û°Ê¿z¿ï
- For Each R In .AutoFilter.Range.SpecialCells(xlCellTypeVisible).Rows
- If R.Row > 1 Then
- ReDim Preserve AR(1 To S)
- 'AR(S) = R '¾ã¦C
- AR(S) = Array(R.Cells(1).Value, R.Cells(4).Value) '¤é´Á,²Ó¸`
- S = S + 1
- End If
- Next
- .AutoFilterMode = False
- End With
- Next
- Rng.Offset(1).Resize(S - 1, UBound(AR(1))) = Application.Transpose(Application.Transpose(AR))
- Application.ScreenUpdating = True
- End Sub
½Æ»s¥N½X |
|