- ©«¤l
- 6
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 14
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2018-5-23
- ³Ì«áµn¿ý
- 2019-4-30
|
[µo°Ý] ¬d¸ß¤é´Á±a¥X¦¹¤é´Áªº¨Cµ§¸ê®Æ
¥»©«³Ì«á¥Ñ chyong911 ©ó 2019-4-25 15:33 ½s¿è
¦U¦ì«e½ú¦n¡A¦]¬°¦Û¾ÇVBA¡A·§©À¨S¦³«Ü¯Â¼ô¡A°µ¨ì¤@¥b¥dÃö¤F¡A¸÷¨D¨ó§UQQ
·Qn¼g¤@½g¥i¥H¥Î"¤ä²¼¨ì´Á¤é"¨Ó±q¸ê®Æ®w«õ¥X¦¹¨ì´Á¤éªº¨Cµ§¤ä²¼¸¹(¤£n«½Æ)¤Î¦¹¤ä²¼¸¹ªº¶Ç²¼³æ¸¹¡B§I²{¤é¡B¤½¥q§O¡A¦ý¥Ø«e§Ú¼gªºVBA¥Ø«e¥u¯à¼g¥X¤@µ§Orz
§Ú«ä¦Ò¥XªºÅÞ¿è¥Ü·N¹Ï¦p¤U(¦ý¥Ø«e¼g¤£¥X¨Ó)
¼gªºVBA¬°¡G
PS³o¤@¬q¨C¦¸«ö¶s¤U¥h³£¶]¶W¤[¡A¬O¤£¬O§Ú¼g±o¤Ó¤£ºë²¤FQQ¦³§ó¦nªº¤è¦¡¶Ü?
¤ä²¼¬d¸ß.rar (129.42 KB)
Private Sub ¬d¸ß_Click()
'Ãö³¬¿Ã¹õ¸õÅD
Application.ScreenUpdating = False
Sheets("²¼¾Úñ¦¬³æ").Select
'¶×¥XÄæ¦ì¨Ï¥Î
Dim NumberColumn, DayColumn, SummonsColumn, BusinessColumn As Integer '¤ä²¼¸¹ '¨ì´Á¤é'¶Ç²¼³æ¸¹'¤½¥q§O
X = Sheets("²¼¾Úñ¦¬³æ").Cells(9, "W") '¿é¤J¨ì´Á¤é
'¹w³]Äæ¦ì¦ì¤l
NumberColumn = 6
DayColumn = 6
BusinessColumn = 6
SummonsColumn = 6
'²MªÅ¬d¸ßµ²ªG
ClearFunction
'°õ¦æ¬d¸ß
For i = 3 To 1000 'data¤W1000µ§
'InStr·|¶Ç¦^ Variant (Long)¡A«ü©w¥t¤@Ó¦r¦ê¤º¬YÓ¦r¦êªº²Ä¤@Ó¥X²{¦ì¸m¡C
'InStr([ start ], string1, string2, [ compare ])
'If Sheets("¨t²Î³]©w").Cells(i, "D").Contains(x) Then
If InStr(Sheets("À³¥I²¼¾Údata").Cells(i, "C"), X) > 0 Then '§ä¨ì²Ä¤@®æ¸ê®Æ
'Value
r = Sheets("À³¥I²¼¾Údata").Cells(i, "AC").Row
v = Sheets("À³¥I²¼¾Údata").Cells(i, "AC").Value
For p = 0 To v - 1
Sheets("²¼¾Úñ¦¬³æ").Cells(SummonsColumn, "X") = Sheets("À³¥I²¼¾Údata").Cells(i, "C") '¶Ç²¼³æ¸¹
Sheets("²¼¾Úñ¦¬³æ").Cells(NumberColumn, "Y") = Sheets("À³¥I²¼¾Údata").Cells(i, "V") '¤ä²¼¸¹
Sheets("²¼¾Úñ¦¬³æ").Cells(DayColumn, "z") = Sheets("À³¥I²¼¾Údata").Cells(i, "Y") '¨ì´Á¤é
Sheets("²¼¾Úñ¦¬³æ").Cells(BusinessColumn, "aa") = Sheets("À³¥I²¼¾Údata").Cells(i, "D") '¤½¥q§O
Next
p = p + 1
End If
Next
NumberColumn = NumberColumn + 1
DayColumn = DayColumn + 1
SummonsColumn = SummonsColumn + 1
BusinessColumn = BusinessColumn + 1
Sheets("²¼¾Úñ¦¬³æ").Select
End Sub
------------------------------------------------------------------------------------
Private Sub ²M°£¬d¸ß_Click()
'Ãö³¬¿Ã¹õ¸õÅD
Application.ScreenUpdating = False
Sheets("²¼¾Úñ¦¬³æ").Range("X6:AA17").ClearContents
Sheets("²¼¾Úñ¦¬³æ").Cells(6, "W").ClearContents
Sheets("²¼¾Úñ¦¬³æ").Cells(9, "W").ClearContents
End Sub
--------------------------------------------------------------------------------------
Private Sub ClearFunction()
'Ãö³¬¿Ã¹õ¸õÅD
Application.ScreenUpdating = False
Sheets("²¼¾Úñ¦¬³æ").Range(Cells(6, 24), Cells(12, 29)).ClearContents
End Sub
¥H¤W³Â·Ðª©¤Wªº¦U¦ì«e½ú«ü±Ð¤FOrz |
|