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

[µo°Ý] Excel inputbox °j°é °ÝÃD

[µo°Ý] Excel inputbox °j°é °ÝÃD

¦]¤u§@¤W¤@­Ó¤p°ÝÃD·Q¼g¦¨ µ{¦¡¥hRUN
¦p¹Ï©Ò¥Ü

¥Ø«e§Ú¼gªºµ{¦¡½X¥u¯à³æµ§¿é¤J¡AµM«á¨C¿é¤J§¹¤@µ§·|¦Û°Ê¦sÀÉ
§Ú·Q§ï¼g¦¨²Ä¤@¦¸ÂI¿ï¸õ¥X¨Óªºinputbox ¥u¿é¤J¤u¸¹
¦A¨Ó¶}©l¸õ¦^°é ¿é¤JMO
ª½¨ì§Ú«ö¨ú®ø¥L´N§â§Ú¦^°é¿é¤J¤¤ªº°T®§¦Û°Ê±a¥X¨Ó¡A¤u¸¹³¡¤À¯à¦Û°Ê¶ñ¤W¶Ü?

µ{¦¡½X°Ñ¦Ò  ½Ð°Ý¦p¦ó­×§ï¦¨§Ú¹Ï»¡ªº¨º¼Ë©O?
  1. Sub ½Ð¿é¤J()


  2.     x = InputBox("½Ð¿é¤J¦¬®ÆOP¤u¸¹ [ Please enter Operator ID ]", "½Ð¿é¤J¦¬®ÆOP¤u¸¹  [Please enter Operator ID ]", "")
  3.     y = InputBox("½Ð¿é¤JMO, ¿é¤J§¹²¦½Ð«ö¨ú®øÁä [ Please enter MO ]", "½Ð¿é¤JMO [ Please enter MO ]", "")


  4.     Dim c1 As Integer
  5.     c1 = 2
  6.     While Cells(c1, 2) <> ""
  7.         c1 = c1 + 1
  8.     Wend
  9.     Cells(c1, 1) = x
  10.     Cells(c1, 2) = y
  11.     Cells(c1, 3) = Now()


  12.     ActiveWorkbook.Save

  13. End Sub
½Æ»s¥N½X

¦^´_ 1# v03586
  1. Sub ½Ð¿é¤J()
  2.     Dim x, y

  3.     x = InputBox("½Ð¿é¤J¦¬®ÆOP¤u¸¹ [ Please enter Operator ID ]", "½Ð¿é¤J¦¬®ÆOP¤u¸¹  [Please enter Operator ID ]", "")
  4.     If x = "" Then Exit Sub
  5.     Do
  6.         y = InputBox("½Ð¿é¤JMO, ¿é¤J§¹²¦½Ð«ö¨ú®øÁä [ Please enter MO ]", "½Ð¿é¤JMO [ Please enter MO ]", "")
  7.         If y = "" Then Exit Do
  8.         With Cells(Rows.Count, 1).End(xlUp)
  9.             .Cells(2, 1) = x
  10.             .Cells(2, 2) = y
  11.             .Cells(2, 3) = Now
  12.         End With
  13.     Loop

  14.     ActiveWorkbook.Save
  15. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

  1. Sub ½Ð¿é¤J()
  2.     Dim X   As Variant
  3.     Dim Y   As Variant
  4.     Dim C1  As Integer
  5.    
  6. EnterID:
  7.     X = InputBox("½Ð¿é¤J¦¬®ÆOP¤u¸¹ [ Please enter Operator ID ]", "½Ð¿é¤J¦¬®ÆOP¤u¸¹  [Please enter Operator ID ]", "")
  8.     If X = False Then Exit Sub
  9. EnterMo:
  10.     Y = InputBox("½Ð¿é¤JMO, ¿é¤J§¹²¦½Ð«ö¨ú®øÁä [ Please enter MO ]", "½Ð¿é¤JMO [ Please enter MO ]", "")
  11.     If Y = False Then
  12.       If MsgBox("§Aªº¿é¤J¦³»~¡A¬O§_­«·s¿é¤J¤@­ÓMO?" & vbCrLf & _
  13.                 "ÂIÀ»""¬O""­«·s¿é¤J¡A""§_""°h¥X·í¦¸¿é¤J¡C", vbYesNo Or vbQuestion, "MO¿é¤J¿ù»~") = vbYes Then GoTo EnterMo
  14.       Exit Sub
  15.     End If
  16.    
  17.     C1 = 2
  18.     While Cells(C1, 2) <> ""
  19.         C1 = C1 + 1
  20.     Wend
  21.     Cells(C1, 1) = X
  22.     Cells(C1, 2) = Y
  23.     Cells(C1, 3) = Now()
  24.     ActiveWorkbook.Save
  25.     GoTo EnterID
  26. End Sub
½Æ»s¥N½X
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥h­þ¡H

TOP

¦^´_ 1# v03586
¤W­±ªº¥N½X¦³»~¡A©«¤l¤£¯à½s¿è¡A­«µo¤@¦¸¥N½X¡G
  1. Sub ½Ð¿é¤J()
  2.     Dim X   As String
  3.     Dim Y   As String
  4.     Dim C1  As Long
  5.    
  6. EnterID:
  7.     X = InputBox("½Ð¿é¤J¦¬®ÆOP¤u¸¹ [ Please enter Operator ID ]", "½Ð¿é¤J¦¬®ÆOP¤u¸¹  [Please enter Operator ID ]")
  8.     If Len(X) < 1 Then Exit Sub
  9. EnterMo:
  10.     Y = InputBox("½Ð¿é¤JMO, ¿é¤J§¹²¦½Ð«ö¨ú®øÁä [ Please enter MO ]", "½Ð¿é¤JMO [ Please enter MO ]", "")
  11.     If Len(Y) < 1 Then
  12.       If MsgBox("§Aªº¿é¤J¦³»~¡A¬O§_­«·s¿é¤J¤@­ÓMO?" & vbCrLf & _
  13.                 "ÂIÀ»""¬O""­«·s¿é¤J¡A""§_""°h¥X·í¦¸¿é¤J¡C", vbYesNo Or vbQuestion, "MO¿é¤J¿ù»~") = vbYes Then GoTo EnterMo
  14.       Exit Sub
  15.     End If
  16.    
  17.     C1 = 2
  18.     While Cells(C1, 2) <> ""
  19.         C1 = C1 + 1
  20.     Wend
  21.     Cells(C1, 1) = X
  22.     Cells(C1, 2) = Y
  23.     Cells(C1, 3) = Now()
  24.     ActiveWorkbook.Save
  25.     GoTo EnterID
  26. End Sub
½Æ»s¥N½X
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥h­þ¡H

TOP

°Ñ¦Ò¡G
¢°¡D¨Ï¥ÎªÌ«ö¡e¨ú®ø¡f§Yµ²§ô
¢±¡D­Y¥¼¿é¤J¦Ó«ö¡eEnter¡f©Î¡e½T©w¡f¡A¤´ºû«ù¦b«Ý©R¿é¤Jª¬ºA¡I
¡@
  1. Sub ¿é¤J()
  2. Dim xR As Range, X, Y, T$, N%
  3. Set xR = Cells(Rows.Count, 2).End(xlUp)(2, 0)
  4. ¡@
  5. T = "½Ð¿é¤J¦¬®ÆOP¤u¸¹ [ Please enter Operator ID ]"
  6. Do: X = InputBox(T, T)
  7. ¡@¡@If StrPtr(X) = 0 Then Exit Sub  '¨Ï¥ÎªÌ«ö¡e¨ú®ø¡f¸õ¥X
  8. Loop Until X <> ""
  9. ¡@
  10. T = "½Ð¿é¤JMO [ Please enter MO ]"
  11. Do: Y = InputBox(T & "¡A¿é¤J§¹²¦½Ð«ö¨ú®øÁä", T)
  12. ¡@¡@If StrPtr(Y) = 0 Then GoTo 999  '¨Ï¥ÎªÌ«ö¡e¨ú®ø¡fµ²§ô
  13. ¡@¡@If Y <> "" Then
  14. ¡@¡@¡@xR.Resize(1, 3) = Array(X, Y, Now)
  15. ¡@¡@¡@Set xR = xR(2, 1): N = N + 1
  16. ¡@¡@End If
  17. Loop
  18. ¡@
  19. 999: If N > 0 Then ThisWorkbook.Save
  20. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# stillfish00


    ÁÂÁ¤j¤jªº«ü±Ð¡Iµ{¦¡½XOK :D   ·PÁ¸ѨM§Ú¤@­Ó¤j°ÝÃD~

TOP

¦^´_ 4# Joforn


    ·PÁ¤j¤jªº¤À·Q~¦ý¥L°j°éÁÙ¬O·|¥X²{¿é¤J¤u¸¹¡A§Ú²z·Qªº³]­p¬OÅý§Úªº¾Þ§@­û¡A¿é¤J¤u¸¹²Ä¤@¦¸´N¦n¡A¨ä¥L´N¨ê±ø½X¡A³o¼Ë¹ï¾Þ§@­ì¨Ó»¡ ¤ñ¸û¤£¥Î¤@ª½¿é¤J¤u¸¹¡A­°§C§@·~®Éªº¥¢»~²v¡A¦ýÁÙ¬O·PÁ±zªº¤À¨É¡AÅý§Ú¤]¨£ÃѨ줣¦Pªºµ{¦¡»yªk­ò!!!  :D

TOP

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


    ·PÁªO¤jªºµ{¦¡½X¡I¦³¹³¨¾§bªº¥\¯àÁÙ¤£¿à­C!!!!¨S¦³¨ú®ø´N¦b«Ý©R Æg :)

TOP

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


    ½Ð°Ý¤@¤Uª©¤j¡A¦pªG§Ú­n¥[¤@¦æ¸ê®Æ¦Û°Ê¤T­Ó¤ë¦Û°Ê§R°£¥i¥H¶Ü¡H
¸ê®Æªí¤W¦A¿é¤J®Éªº®É¶¡©¹«á§PÂ_¤T­Ó¤ë

TOP

¦^´_ 9# v03586


°ò¥»­ì«h¡G
»P¥»©«¥DÃD»Ý¨D¤£¦P¡A©y¥t¶}·s©«¡I
¥t¡D©Ò¿×ªº¡e¤T­Ó¤ë¡f¦p¦ó·§©w¡H­n»¡±o§ó²M·¡¡A³Ì¦nÁ|¹ê¨Ò¡I

TOP

        ÀR«ä¦Û¦b : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD