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

[µo°Ý] µLªk²£¥Íinputbox

[µo°Ý] µLªk²£¥Íinputbox

¥»©«³Ì«á¥Ñ henry860608 ©ó 2020-8-6 00:32 ½s¿è

1.Àɮפ¤¦³4­Ó¤u§@ªí¡A¤À§O¬°¤u§@ªí1~4¡A¤u§@ªí3¦³µ{¦¡½X(¨Ï¥ÎªÌ¶·¿é¤J±K½X)¡A¦ý¬O±q¤u§@ªí1¤Á´«¹L¥h¨ì¤u§@ªí3¡Aµ{¦¡½X¥ýÀˬdÅv­­¡A¤£¨¬«h¿é¤J±K½X¡C¦ý¬O±K½Xªºµøµ¡µLªk²£¥Í¡A¦Ó·|¨ÏÀÉ®×·í±¼¡A½Ð°Ý¦³¤èªk¸Ñ¨M¶Ü?
2.ªþ¥ó»P¥N½X¦p¤U¡C
  1. Public Function InputBoxEr(Sht As Integer, iRow As Integer, Optional AddStr) As String

  2.     Dim Prompt As String, Title As String, Default As String, HelpFile As String, Context As String, Hack As String, tmp As String
  3.     Dim Xpos As Double, Ypos As Double
  4.     Dim i As Integer, Count As Integer, RoleSet As Integer, LmtCnt As Integer, Delay As Integer, min As Integer, sec As Integer
  5.     Dim StartRecTime As Date, EndtRecTime As Date, StartTime As Date, EndTime As Date
  6.    
  7.    
  8.    

  9.     With Sheets(Sht)
  10.         
  11.         Prompt = .Cells(iRow, 1)
  12.         Title = .Cells(iRow, 2)
  13.         Default = .Cells(iRow, 3)
  14.         Xpos = .Cells(iRow, 4)
  15.         Ypos = .Cells(iRow, 5)
  16.         HelpFile = .Cells(iRow, 6)
  17.         Context = .Cells(iRow, 7)
  18.         Hack = .Cells(iRow, 8)
  19.         RoleSet = .Cells(iRow, 10)
  20.         LmtCnt = .Cells(iRow, 11)
  21.         Delay = .Cells(iRow, 12)
  22.         StartRecTime = .Cells(iRow, 13)
  23.         EndtRecTime = .Cells(iRow, 14)
  24.         StartTime = .Cells(iRow, 15)
  25.         EndTime = .Cells(iRow, 16)
  26.         Count = .Cells(iRow, 8)

  27.         If RoleSet >= 0 Then
  28.         Else
  29.             MsgBox "¿ù»~!": Exit Function
  30.         End If
  31.         If (LmtCnt > 0 And Delay > 0) Or (LmtCnt = 0 And Delay = 0) Then
  32.         Else
  33.             MsgBox "¿ù»~!": Exit Function
  34.         End If
  35.         If RoleSet > Sheets(2).Cells(4, 3) Then
  36.             MsgBox "Åv­­¤£¨¬": Exit Function
  37.         ElseIf EndtRecTime > Now() Then
  38.             min = Int((Now() - EndtRecTime) / 24 / 60): sec = Int((Now() - EndtRecTime) / 24 / 60 / 60)
  39.             MsgBox "¤w¦b " & Delay & " ¤ÀÄÁ¤º¹Á¸Õ¾Þ§@ " & LmtCnt & " ¦¸¡A½Ð©ó" & EndtRecTime & "«á¹Á¸Õ¡A³Ñ¤U" & min & "¤À" & sec & "¬í": Exit Function
  40.         ElseIf StartTime > Now() And Not (IsEmpty(StartTime)) Then
  41.             MsgBox "¨t²Î¥Ø«e©|¥¼¶}©ñ¡I": Exit Function
  42.         ElseIf EndTime < Now() And Not (IsEmpty(EndTime)) Then
  43.             MsgBox "¨t²Î¥Ø«e¤wÃö³¬¡I": Exit Function
  44.         Else
  45.             .Cells(iRow, 13) = Now(): .Cells(iRow, 14) = .Cells(iRow, 13) + LmtCnt / 24 / 60
  46.         End If
  47.         If Count = 0 And EndtRecTime <= Now() Then
  48.             .Cells(iRow, 17) = 1
  49.         Else
  50.             .Cells(iRow, 17) = .Cells(iRow, 17) + 1
  51.         End If
  52.         If IsEmpty(Hack) Then
  53.             'If Xpos = 0 Or Ypos = 0 Then
  54.             '    InputBoxEr = InputBox(Prompt, Title, Default, , , HelpFile, Context)
  55.             'Else
  56.                 InputBoxEr = InputBox(Prompt, Title, Default, Xpos, Ypos, HelpFile, Context)
  57.             'End If
  58.         Else
  59.                 tmp = Sheets(2).Cells(5, 3): Sheets(2).Cells(5, 3) = Hack
  60.             'If Xpos = 0 Or Ypos = 0 Then
  61.             '    InputBoxEr = InputBoxDK(Prompt, Title, Default, , , HelpFile, Context)
  62.             'Else
  63.                 InputBoxEr = InputBoxDK(Prompt, Title, Default, Xpos, Ypos, HelpFile, Context)
  64.             'End If
  65.         End If
  66.             
  67.     End With
  68.     Sheets(2).Cells(5, 3) = tmp
  69. End Function
½Æ»s¥N½X
test(1090805).rar (18.81 KB)

        ÀR«ä¦Û¦b : ¤f»¡¦n¸Ü¡B¤ß·Q¦n·N¡B¨­¦æ¦n¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD