- ©«¤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
|
¦^´_ 4# bridetobe
¸Õ¸Õ¬Ý- Private Sub CommandButton1_Click()
- Dim srcrange As Range
- Dim a_date ' As String
- Dim fndrange, fstaddress, i
- a_date = InputBox("¿é¤J¤é´Á(¨Ò2014/7/1):", , "2014/7/1")
- If a_date = "" Then Exit Sub '¨ú®ø®É
- With Sheet2
- Set srcrange = .Range("A2", .[a2].End(xlDown))
- Set fndrange = srcrange.Find(what:=a_date, AFTER:=srcrange(srcrange.Count), LookIn:=xlValues) '·j´M¤å¦r
- 'After ¿ï¾Ü©Êªº Variant¡C «ü©wÀx¦s®æ¡A´M§ä±N±q¸ÓÀx¦s®æ¤§«á¶}©l¡C¦¹Àx¦s®æ¹ïÀ³©ó±q¨Ï¥ÎªÌ¤¶±´M§ä®Éªº¨Ï¥Î¤¤Àx¦s®æ¦ì¸m¡C
- 'ª`·N After ¥²¶·¬O´M§ä½d³ò¤¤ªº³æÓÀx¦s®æ¡C½Ð°O¦í´M§ä¬O±q¸ÓÀx¦s®æ¤§«á ¶}©lªº¡F¥²¶·µ¥¨ì¸Ó¤èªk´`Àô¦^¨ì¦¹Àx¦s®æ®É¡A¤~·|·j´M¨ä¤º®e¡C
- '¦pªG¥¼«ü©w¦¹¤Þ¼Æ¡A·j´M±N±q½d³òªº¥ª¤W¨¤Àx¦s®æ¤§«á¶}©l
- End With
- If Not fndrange Is Nothing Then
- 'fstaddress = fndress = fndrange.Address '³o¸Ì¿ù»~ Åý¥LµL¤îºÉªº¶K¤U¥h
- fstaddress = fndrange.Address
- i = 3
- Do
- Cells(i, 1).Value = fndrange.Offset(, 1)
- Cells(i, 2).Value = fndrange.Offset(, 2)
- Cells(i, 3).Value = fndrange.Offset(, 3)
- Cells(i, 4).Value = fndrange.Offset(, 4)
- Cells(i, 5).Value = fndrange.Offset(, 5)
- Cells(i, 6).Value = fndrange.Offset(, 6)
- Cells(i, 7).Value = fndrange.Offset(, 7)
- Set fndrange = srcrange.FindNext(AFTER:=fndrange)
- i = i + 1
- Loop Until fndrange.Address = fstaddress
- Else
- MsgBox ("¨S¦³¸ê®Æ")
- End If
- End Sub
½Æ»s¥N½X |
|