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

vba¨D´©

vba¨D´©

¶µ¥ØUserForm26.Show¡A­n¦p¦ó¿é¤J§¹B37¡ãB49©¹¥k¤U¦b¿é¤JC37¡ãC49......¨ìM37~M49
¶µ¥ØUserForm12.Show¡A­n¦p¦ó¿é¤J§¹B50¡ãB54©¹¥k¤U¦b¿é¤JC50¡ãC54......¨ìP50~P54
¤Î¨­¤ÀÃÒÅçÃÒ

ªí³æ¿é¤J®æ¦¡.rar (52.8 KB)

¦^´_ 1# sillykin
´£¨Ñ UserForm26 ¨BÆJ½Ð¦Û¦æ°Ñ¦Ò¨Ã¼¶¼g(©ó½T©w¶s¥[¤Jµ{¦¡½X)¡G

1.ÂI¿ï [½T©w] ¶s«á¡Aĵ§i¬O§_¯uªº­n±N¸ê®Æ¼g¤J¤u§@ªí¡A­Y¤£¬Oªº¸Ü«h°h¥Xµ{§Ç¡A¥D­nªº¥Î·N¬OÁקK»~IJ¾÷¨î¡C
2.±q²Ä37¦Cªº³Ì¥kÄ橹¥ª§ä¨ì¦³¸ê®ÆªºÄæ(¨Ì§Aªº½d¨Ò¬O§ä¨ìBÄæ)¡A¦A¥[1Äæ(¨Ì§Aªº½d¨Ò¥[1«á¬OCÄæ)¡C
   µ{¦¡½X¡G ©w¦ìÄæ = Cells(37, Cells.Columns.Count).End(1).Column + 1
3.Àˬd¸Ó [©w¦ìÄæ] ¬O§_¤j©óMÄæ¡A­Y¬Oªº¸Ü«hĵ§i"¸T¤î¦A¦¸¼g¤J"°T®§«á°h¥Xµ{§Ç¡C
4.±N UserForm26 ¤º¤å¦r¤è¶ôªº¸ê®Æ¡A¨Ì¾Ú [©w¦ìÄæ] ªºÄæ¦ì¡A¨Ì§Ç¼g¤J¤u§@ªíªºÀx¦s®æ¤º¡C
5.§¹¦¨¼g¤J«á¡A²M°£ UserForm26 ¤ºªº¸ê®Æ¡A°µ¬°·Ç³Æ¤U¤@µ§ªº¸ê®Æµn¿ý§@·~¡C

¤W­z²Ä5¶µ¤]¥i¥H¥Î Unload UserForm26 ¤èªk¨ÓÃö±¼ UserForm26¡A¦]¬° UserForm26 §A¨Ã¨S¦³¥t¥~µ²§ô©Î°h¥Xªº«ö¶s¡C

¦Ó UserForm12 ¤§§@ªk¥ç¦p¤W¡C

TOP

¦^´_ 2# Kubi


    ·PÁ¦^ÂÐ...
¦ý¸Õ¤FÁÙ¬O¤£¦æ,¥i¯à¬O¦Û¨­¯à¤O¤£¤Ó¦n

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2017-3-12 07:46 ½s¿è

¦^´_ 3# sillykin

¸Õ¸Õ¬Ý
  1. Private Sub TextBox3_Change()
  2.     Dim Msg As Boolean
  3.     '°ò¥»¨­¤ÀÃÒÅçÃÒ¡A
  4.             '1.¬°­n10½X -> Len(TextBox3) = 10
  5.             '2 ²Ä¤@½X¬°­^¤å¦r¥À«á9½X¥þ¬°¼Æ¦r ->TextBox3.Text Like "[A-z]#########"
  6.             
  7.    '**** ¦ý¹ê»Ú¤W¬F©²¦³¨­¤ÀÃÒªºÅçÃÒ³W«h *****
  8.     Msg = Len(TextBox3) = 10 And TextBox3.Text Like "[A-z]#########"   '¨ä¤¤¤@¶µ¤£¬°¯u Msg =False
  9.     'Label18.¬°ªí³æ¤W,²Î¤@½s¸¹ªºLabel±±¨î¶µ
  10.     Label18.BackColor = IIf(Msg, &HFFFFC0, &HFF&)  '«ü©wª«¥óªº­I´º¦â±m¡C
  11.    
  12. End Sub

  13. Private Sub CommandButton2_Click()  'ªí³æ¤W¸ê®Æ¿é¤J,½Ð·s¼W¤@«ö¶s,¦¹«öÁä¯Ãªºµ{¦¡½X
  14.     Dim Msg As String, Ar(), E As Variant, Rng As Range
  15.     Ar = Array(TextBox2, TextBox3, TextBox4, TextBox5, TextBox6)  '±±¨î¶µ¸m¤J°}¦C
  16.     '********¨¾§bµ{¦¡½X**********
  17.     Msg = IIf(Label18.BackColor = &HFF&, "²Î¤@½s¸¹ ¦³¿ù»~", "")
  18.     For Each E In Ar
  19.         If E = "" Then Msg = Msg & IIf(Msg <> "", vbLf, "") & "¸ê®Æ¿é¤J¤£»ô¥þ": Exit For
  20.     Next
  21.     If Msg <> "" Then MsgBox Msg: Exit Sub
  22.     Set Rng = Range("b50:P50")              '«ü©wªº¦ì¸m
  23.     E = Application.CountA(Rng)             '­pºâ¦ì¸m¤¤¦³¸ê®Æªº­Ó¼Æ
  24.     '**«ü©w¦ì¸m,¸ê®Æ¦ì¸mªºÀˬd
  25.     If E > 0 Then
  26.         If E = Rng.Cells.Count Then MsgBox "¸ê®Æ¤wº¡ ! ½ÐÀˬd ": Exit Sub  
  27.         If Rng.Cells(E).Address <> Rng.Cells(Rng.Cells.Count).End(xlToLeft).Address Then MsgBox "¸ê®Æ¦ì¸m¦³»~ ! ½ÐÀˬd ": Exit Sub
  28.     End If
  29.    
  30.     '********¨¾§bµ²§ô**********
  31.     If MsgBox("½T©w ¿é¤J¸ê®Æ!", vbYesNo) = vbNo Then Exit Sub
  32.     '******¸ê®Æ¿é¤J*************************************
  33.     With Rng.Offset(0, E)
  34.         .Resize(UBound(Ar) + 1, 1).Value = Application.WorksheetFunction.Transpose(Ar)
  35.     End With
  36. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ sillykin ©ó 2017-3-11 22:53 ½s¿è

¦^´_ 4# GBKEE


    ·PÁÂG¤jªº¦^ÂÐ
¦ý­n¿é¤J¨ìD50µo¥Í¿ù»~
¨­¤ÀÃÒµLªkÅçÃÒ...¤£ª¾¬O§_§Ú©ñ¿ù¦ì¸m¤F¶Ü???
½Ð¤j®v«üÂI

¸ê®Æ¦³»~.JPG (150.77 KB)

¸ê®Æ¦³»~.JPG

ªí³æ¿é¤J®æ¦¡.rar (60.68 KB)

TOP

¦^´_ 5# sillykin

³o¦æµ{¦¡½X¬O¿ù»~¦h¾lªº½Ð§R±¼
  1.       If Rng.Cells(Rng.Cells.Count).End(xlToLeft).Address <> Rng.Cells(1).Address Then MsgBox "¸ê®Æ¦ì¸m¦³»~ ! ½ÐÀˬd ": Exit Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ sillykin ©ó 2017-3-12 11:26 ½s¿è

¦^´_ 6# GBKEE


    ÁÂÁÂG¤jªº¦^ÂÐ
    ¤x§R°£¦¹±ø  If Rng.Cells(Rng.Cells.Count).End(xlToLeft).Address <> Rng.Cells(1).Address Then MsgBox "¸ê®Æ¦ì¸m¦³»~ ! ½ÐÀˬd ": Exit Sub¥i¥¿±`¹B§@
,¦ý¿é¤J¨­¤ÀÃÒÁÙ¬OµLªkÀËÅç¬O§_¿é¤J¥¿½T»P§_?
¬O­n¦b¥[¤J¬F©²ÅçÃÒµ{§Ç¶Ü???
¨Ò¦p
      Private Sub Worksheet_Change(ByVal Target As Range) '­É¤á¨­¤ÀÃÒÀˬd
Dim T, i%, S
With Target
      If .Count > 1 Then Exit Sub
      If Intersect([B51:P51], .Cells) Is Nothing Then Exit Sub
      Application.EnableEvents = False
      .Value = UCase(.Value)
      Application.EnableEvents = True
      
      If Not .Value Like "[A-Z]#########" Then MsgBox "¨­¥÷ÃÒ¿é¤J¿ù»~!!": Exit Sub
      T = InStr("ABCDEFGHJKLMNPQRSTUVXYWZIO", Left(.Value, 1)) + 9 & Mid(.Value, 2, 8)
      For i = 1 To 10
          S = S + Mid(T, i, 1) * Left(11 - i, 1)
      Next i
      T = Right(10 - Right(S, 1), 1)
      If T <> Mid(.Value, 10, 1) Then MsgBox "¨­¥÷ÃÒ¦r¸¹¿ù»~¡IÀˬd½X¡G" & T
End With
¤p©f¤£¤~

TOP

¦^´_ 7# sillykin


   
  1. Private Sub TextBox3_Change()
  2.     Dim Msg As Boolean
  3.     '°ò¥»¨­¤ÀÃÒÅçÃÒ¡A
  4.             '1.¬°­n10½X -> Len(TextBox3) = 10
  5.             '2 ²Ä¤@½X¬°­^¤å¦r¥À«á9½X¥þ¬°¼Æ¦r ->TextBox3.Text Like "[A-z]#########"
  6.    '**** ¦ý¹ê»Ú¤W¬F©²¦³¨­¤ÀÃÒªºÅçÃÒ³W«h *****
  7.     Msg = Len(TextBox3) = 10 And TextBox3.Text Like "[A-z]#########"   '¨ä¤¤¤@¶µ¤£¬°¯u Msg =False
  8.     'Label18.¬°ªí³æ¤W,²Î¤@½s¸¹ªºLabel±±¨î¶µ
  9.     Label18.BackColor = IIf(Msg, &HFFFFC0, &HFF&)  '«ü©wª«¥óªº­I´º¦â±m¡C
  10.     If Msg Then Àˬd½X
  11. End Sub
  12. Function Àˬd½X() As Boolean      '¨­¤ÀÃҳ̫á¤@½XÀˬd
  13.     Dim T As String, I As Integer, S As Long
  14.     T = InStr("ABCDEFGHJKLMNPQRSTUVXYWZIO", Left(TextBox3, 1)) + 9 & Mid(TextBox3, 2, 8)
  15.     For I = 1 To 10
  16.         S = S + Mid(T, I, 1) * Left(11 - I, 1)
  17.     Next I
  18.     T = Right(10 - Right(S, 1), 1)
  19.      ' If T <> Mid(TextBox3, 10, 1) Then MsgBox "¨­¥÷ÃÒ¦r¸¹¿ù»~¡IÀˬd½X¡G" & T
  20.     Label18.BackColor = IIf(T <> Mid(TextBox3, 10, 1), &HFFFFC0, &HFF&)
  21. End Function
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2017/3/12 20:12): Àˬd¨­¤ÀÃҳ̫á¤@½XªºÅÞ¿è§Ú¤£²M·¡.

¦^´_ 8# GBKEE


    ÁÂÁÂGBKEE­@¤ß±Ð¾É¤Î«ü±Ð
¦ý¤p©f¸Õ¤F¨­¤ÀÃÒ¿é¤J¿ùªº¨­¤ÀÃÒ¤]¤@¼Ë¥i¿é¤J
¦Ó¤£·|¥X²{¿ù»~½Ð§ó¥¿
¯à§_¦b½ÐGBKEE¤j¤j¯à¦b«ü¾É¤@¤U¶Ü???

TOP

        ÀR«ä¦Û¦b : ¥@¤W¦³¨â¥ó¨Æ¤£¯àµ¥¡G¤@¡B§µ¶¶ ¤G¡B¦æµ½¡C
ªð¦^¦Cªí ¤W¤@¥DÃD