ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¦p¦óÅýinputbox ³sÄò²£¥Í

¦p¦óÅýinputbox ³sÄò²£¥Í

¦U¸ô¯«¤H¡A¤p§Ì²{¦³¤@§xÂZ¡A´N¬O·í¦b®Ö¹ï®Ñ¦W®É±Æ¤W¬[®É(Â\©ñ²M³æ)¡AÁ`¬O­n°Å°Å¶K¶K¡C©Ò¥H·Q¥Îexcel ¼g¤@­Ó°j°éµ{¦¡¡AÅý©±ªø¯àª½±µ¿é¤J¼Æ¦r«á¡A¯à¹ïÀ³¨ìªí®æ°Å¤U¨Ó¡A²£¥Í¥t¤@¥÷ªºÂ\©ñ²M³æ¡C¦ý¤£ª¾­n«ç»òÅýinputbox ¯à¦³³sÄò¿é¤Jªº¥\¯à¡A¤Î·í¿é¤J¨ì¯S©w­È®É¯à¦Û°ÊÃö±¼¡C·Ð½Ð«ü¾É¤F¡AÁÂÁÂ

dim n as page
st = application.inputbox("¼Æ¦r", type:=1)
for each n in page("A2"A50")
if n.value=st then
range(Cells(st+1,"A"),Cells(st+1,"B")).select
(¤w¿ï¤Wªº«þ¨©¨ìsheet(2), ¶K¤W(°²³]¦³¤å¦rªº¸Ü¸õ¨ì¤U¤@¦æ) '³o¬q¤£·|¼g
msgbox"¤w¿ï¤W   " & Cells(st+1,"B").text

else
if st=0
msgbox"¤w§¹¦¨¿ï¶µ"

end if
next

­n¤£­n§ï¥ÎTextBox¸Õ¸Õ

¦³¸ê®Æ´N´«¤U¤@¦C
Ax = Sheets(2).[A65536].End(xlUp).Row + 1
Rows(n.Row).Copy Sheets(2).Cells(Ax, 1)

TOP

¦^´_ 2# koo

ÁÂÁ¡A§Ú«Ý·|¸Õ¬Ý¬Ý. ¦ý§ó¤jªº°ÝÃD¬O¦b³sÄò¿é¤J¡K

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2015-10-6 14:34 ½s¿è

¨SÀɮסA¥u¯à²q¡A½Ð¦Û¦æ¥h®M¡G
  1. Sub Find_No()
  2. Dim ST, xF As Range
  3. Do
  4. ¡@ST = InputBox("¼Æ¦r")
  5. ¡@If StrPtr(ST) = 0 Then Exit Do '«ö¡e¨ú®ø¡f¸õ¥X
  6. ¡@If ST = "000" Then Exit Do '¿é¤J¡e¯S©w­È¡f¸õ¥X
  7. ¡@If ST <> "" Then
  8. ¡@¡@¡@Set xF = [®Ñ¥»²M¥U!A2:A50].Find(ST, Lookat:=xlWhole)
  9. ¡@¡@¡@If xF Is Nothing Then
  10. ¡@¡@¡@¡@¡@MsgBox "§ä¤£¨ì½s¸¹¡A½Ð­«·s¿é¤J¡I¡@"
  11. ¡@¡@¡@Else
  12. ¡@¡@¡@¡@¡@xF.Resize(1, 2).Copy [Â\©ñ²M³æ!A65536].End(xlUp)(2)
  13. ¡@¡@¡@¡@¡@Beep
  14. ¡@¡@¡@End If
  15. ¡@End If
  16. Loop
  17. End Sub
½Æ»s¥N½X

TOP

³sÄò¿é¤J¤]¥i¥H¥Îcall¦Û¤v
  1. Sub test()
  2. Dim a As Integer
  3. a = InputBox("½Ð¿é¤J½s¸¹", "¿é¤J")
  4. If a = 3 Then Exit Sub    ''¿é¤J3Â÷¶}
  5. Cells([A65536].End(xlUp).Row + 1, 1) = a   ''¤U¤@¦C¶}©l¿é¤J
  6. Call test
  7. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# ­ã´£³¡ªL

Hi ­ã¤j, §Ú¤µ¤Ñ´ú¸Õ¤F, ­n­×§ï¤U¦C¤G­Ó§Y¥i¨Ï¥Î. ·PÁÂ.
¥u¬O·|¦³·í¥X²{inputbox®É¡A¥»¨­ªº¨ú®øµLªkÂ÷¶}, ­n¿é¤J0 or 000 §Y¥i¸õ¥X. «D±`ÁÂÁÂ.


Sub Find_No()
Dim ST, xF As Range
Do
¡@ST = InputBox("¼Æ¦r")
¡@If ST = 0 Then Exit Do '«ö¡e¨ú®ø¡f¸õ¥X
¡@If ST = "000" Then Exit Do '¿é¤J¡e¯S©w­È¡f¸õ¥X
¡@If ST <> "" Then
¡@¡@¡@Set xF = [®Ñ¥»²M¥U!A2:A50].Find(ST, Lookat:=xlWhole)
¡@¡@¡@If xF Is Nothing Then
¡@¡@¡@¡@¡@MsgBox "§ä¤£¨ì½s¸¹¡A½Ð­«·s¿é¤J¡I¡@"
¡@¡@¡@Else
¡@¡@¡@¡@¡@xF.Resize(1, 2).Copy [Â\©ñ²M³æ!A65536].End(xlUp)(2)
¡@¡@¡@¡@¡@Beep
¡@¡@¡@End If
¡@end If
Loop
End Sub

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2015-10-6 09:39 ½s¿è

¦^´_ 8# kerochen


If StrPtr(ST) = 0 Then Exit Do '«ö¡e¨ú®ø¡f¸õ¥X
±zªºª©¥»µLªk¨Ï¥Î¶Ü¡H

TOP

¦^´_ 8# kerochen
StrPtr ¬O¥¼¤½¶}ªº function , ¦³°ÝÃD¥i¥H§ï¥Î
If ST = "" Then Exit Do   '«ö¡e¨ú®ø¡f¸õ¥X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 8# ­ã´£³¡ªL

¬Oªº= =. ÁÙ¬OÁÂÁ­ã¤j. !

TOP

¦^´_ 8# stillfish00

·PÁÂ!!  Still fish, §Ú©ú¤Ñ¤W¯Z¸Õ¬Ý¬Ý.

TOP

        ÀR«ä¦Û¦b : ¯à¥I¥X·R¤ß´N¬OºÖ¡A¯à®ø°£·Ð´o´N¬O¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD