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

[µo°Ý] UserFormªí³æ¬ÛÃö°ÝÃD

[µo°Ý] UserFormªí³æ¬ÛÃö°ÝÃD

¤p§Ì¹Á¸Õ¼¶¼g¤@­Ó®w¦sºÞ²z¨t²Î
§Æ±æ¨Ï¥ÎªÌ¾Þ§@¤¶­±´N¦bMain ³o­Ó¸ê®ÆÄæ´N¦n
§Ú¥Ø«e¼g¥X¨Óªºµ{¦¡½X»Ý­n ¸õ¨ìFMC Input Database ¸ê®ÆÄæ¤~¯à°õ¦æ
Q1: ½Ð°Ý¤j¤j­Ì¦p¦ó­×§ï©O?
Q2: ½Ð°Ý¿é¤J§¹²¦ÂI¿ïok«á¯à¦Û°ÊÃö³¬ªí³æ¶Ü? µ{¦¡½X¦p¦ó¥[©O? §Ú¥[¤Fexit sub ¦ü¥GµLªkÃö³¬
Q3: ½Ð°ÝCancel«ö¶s ¦p¦ó¼g¤J¥\¯à(Ãö³¬ªí³æ)
Q4: ½Ð°Ý§Úªº§PÂ_¦¡¼g¦b«á­±¹ï¶Ü? §Ú°õ¦æ«á,°²³]§Ú¿é¤Jº|±¼¨ä¤¤¤@¶µ,¸ê®Æ®w¬OÅã¥Üº|±¼¨º¶µªÅ¥Õ ,¨ä¥L¬O¦³¸ê®Æªº

¦pªG­×§ï§¹¦¨!! ¦b©ñ¤W¨Ó¸ò¤j®a¤À¨É!!! ¦ý§Ú¸ê®Æ®wªº«Ø¥ß¬O¥Î³Ì²Âªº¤è¦¡...(·s¤â)

¥Ø«e¦pªG¦bMain°õ¦æ·|¸õ¥X¨Óªº¿ù»~
ERROR.jpg
§ÚªºUserform°t¸m¹Ï
  1. Private Sub CommandButton1_Click()
  2. Sheets("FMC Input Database").Range("A2").Select
  3. Selection.End(xlDown).Select
  4. If OptionButton1.Value = True Then Sheets("FMC Input Database").Range("A" & ActiveCell.Cells.Row + 1) = "201"
  5. If OptionButton2.Value = True Then Sheets("FMC Input Database").Range("A" & ActiveCell.Cells.Row + 1) = "Setup Return"
  6. If OptionButton3.Value = True Then Sheets("FMC Input Database").Range("A" & ActiveCell.Cells.Row + 1) = "261"

  7. Sheets("FMC Input Database").Range("B" & ActiveCell.Cells.Row + 1) = TextBox1.Text
  8. Sheets("FMC Input Database").Range("C" & ActiveCell.Cells.Row + 1) = TextBox2.Text
  9. Sheets("FMC Input Database").Range("D" & ActiveCell.Cells.Row + 1) = TextBox3.Text
  10. Sheets("FMC Input Database").Range("E" & ActiveCell.Cells.Row + 1) = TextBox4.Text
  11. Sheets("FMC Input Database").Range("F" & ActiveCell.Cells.Row + 1) = TextBox5.Text

  12. If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or OptionButton1.Value = False And OptionButton2.Value = False And OptionButton3.Value = False Then
  13.     MsgBox ("¸ê®Æ¥¼¿é¤J§¹¾ã¡A ¡y * ¡z ¥²¶·¿é¤J" & vbCrLf & _
  14.     "Data is not enter the full , ¡y * ¡z you must fill ")
  15. Exit Sub
  16. End If
  17. End Sub
½Æ»s¥N½X

Q5: ¥H¤Wªí³æ¿é¤J«á·Q¦bGÄæ¥[¤W¿é¤J®É¶¡ =Now() , ½Ð°Ý­n¥[¦b­þ¸Ì©O?

TOP

ªþ¤WÀÉ®×
Q4 °ÝÃD¤w¸Ñ¨M!!! ±ø¥ó¦¡­n©ñ¦b³Ì«e­±!!!
³Ñ¤U°ÝÃD½Ð¨D¨ó§U

Ink Substrate management.rar (330.03 KB)

TOP

µy¦­ª¦¤å¶Ã¸Õ
²×©ó±NQ2~Q5 ¸Ñ¨M

³Ñ¤UQ1°ÝÃD­n³Â·Ð³o¸Ì°ª¤â¨ó§U

§Ú¥Ø«e¼g¥X¨Óªºµ{¦¡½X»Ý­n ¸õ¨ìFMC Input Database ¸ê®ÆÄæ¤~¯à°õ¦æ
§Æ±æ¨Ï¥ÎªÌ¾Þ§@¤¶­±´N¦bMain ³o­Ó¸ê®ÆÄæ´N¦n
½Ð°Ýµ{¦¡½X¦p¦ó°µ­×§ï©O?
  1. Private Sub CommandButton1_Click()
  2. Sheets("FMC Input Database").Range("A2").Select
  3. Selection.End(xlDown).Select
  4. If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or OptionButton1.Value = False And OptionButton2.Value = False And OptionButton3.Value = False Then
  5.     MsgBox ("¸ê®Æ¥¼¿é¤J§¹¾ã¡A ¡y * ¡z ¥²¶·¿é¤J" & vbCrLf & _
  6.     "Data is not enter the full , ¡y * ¡z you must fill ")
  7. Exit Sub
  8. End If
  9. If OptionButton1.Value = True Then Sheets("FMC Input Database").Range("A" & ActiveCell.Cells.Row + 1) = "201"
  10. If OptionButton2.Value = True Then Sheets("FMC Input Database").Range("A" & ActiveCell.Cells.Row + 1) = "Setup Return"
  11. If OptionButton3.Value = True Then Sheets("FMC Input Database").Range("A" & ActiveCell.Cells.Row + 1) = "261"

  12. Sheets("FMC Input Database").Range("B" & ActiveCell.Cells.Row + 1) = TextBox1.Text
  13. Sheets("FMC Input Database").Range("C" & ActiveCell.Cells.Row + 1) = TextBox2.Text
  14. Sheets("FMC Input Database").Range("D" & ActiveCell.Cells.Row + 1) = TextBox3.Text
  15. Sheets("FMC Input Database").Range("E" & ActiveCell.Cells.Row + 1) = TextBox4.Text
  16. Sheets("FMC Input Database").Range("F" & ActiveCell.Cells.Row + 1) = TextBox5.Text
  17. Sheets("FMC Input Database").Range("G" & ActiveCell.Cells.Row + 1) = Now()
  18. UserForm1.Hide
  19. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# v03586


Private Sub CommandButton1_Click()
Dim k&, Arr(1 To 7)¡@'©w¤@­Ó¡e°}¦C¡f®e¯Ç¸ê®Æ
For k = 1 To 5
¡@¡@If k <= 3 Then If Me("OptionButton" & k) = True Then Arr(1) = Me("OptionButton" & k).Caption
¡@¡@'¡Ä¦pªG¿ï¶µ¬° True¡A±N¨ä¡e«ö¶s¤å¦r¡f¥[¤J°}¦C¢°
¡@¡@Arr(k + 1) = Me("TextBox" & k)
¡@¡@'¡Ä±N¤å¦r¤è¶ô¤º®e¥[¤J°}¦C¢±¡ã¢µ
¡@¡@If Arr(k + 1) = "" Then Arr(1) = "": Exit For
¡@¡@'¡Ä¦pªG¤å¦r¤è¶ô¬°ªÅ¡A±N°}¦C¢°²MªÅ¡A¸õ¥X°j°é
Next k
¡@
If Arr(1) = "" Then MsgBox ("¸ê®Æ¥¼¿é¤J§¹¾ã¡A ¡y * ¡z ¥²¶·¿é¤J" & vbCrLf & _
¡@¡@¡@¡@¡@¡@"Data is not enter the full , ¡y * ¡z you must fill "): Exit Sub
'¡Ä¥H¡e°}¦C¢°¡f·í§@Àˬd¿é¤J¬O§_§¹¾ãªº¼Ðªº

Arr(7) = Now¡@
'¡Ä°}¦C¢¶¥[¤J¤é´Á®É¶¡

Sheets("FMC Input Database").Cells(Rows.Count, "A").End(xlUp)(2).Resize(1, 7) = Arr
'¡Ä¶ñ¤J¸ê®Æ
¡@
Unload Me
End Sub

µ{¦¡½X«Ü²³æ¡A½Ð¦Û¦æ¥h´¢¼Ò¡ã¡ã

TOP

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


    ·PÁ¤j¤jªº«ü¾É!!!§â§ÚÃlªø¥B½ÆÂøªºµ{¦¡½X,²µu¤S¦P®ÄªGªº§e²{!!!
¦ý¬O§ÚÁÙ¬O·Q¤F¸Ñ¤@¤U!!ÁקK¤é«á¦³¬Û¦Pªº°ÝÃD~~
¦]¬°§Ú¤§«eªº¤è¦¡³£­n¸õ¨ì¹ïÀ³ªº¸ê®Æªí¤~¯à°õ¦æ
½Ð°Ý¬O³o¬qµ{¦¡½XÅý¸ê®Æªí¤£·|¸õ¹L¥h¶Ü?

Sheets("FMC Input Database").Cells(Rows.Count, "A").End(xlUp)(2).Resize(1, 7) = Arr

TOP

¦^´_ 6# v03586


Sheets("FMC Input Database").Range("A2").Select¡@
Selection.End(xlDown).Select¡@

Select ·|°õ¦æ¡e¿ï¨ú¡f¤u§@ªíªº°Ê§@
Selection ¥u¹ï¡e·í«e¡f¤u§@ªí²£¥Í§@¥Î
©Ò¥H¡A¿ý»s¤§µ{¦¡½X¡A³£¶·¦A°µ­×¹¢¡I
With Sheets("FMC Input Database").Range("A2").End(xlDown)
      .cells(2,1)=??
      .cells(2,2)=??
      ~~
      ~~
End With

TOP

¦^´_ 6# v03586
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Private Sub CommandButton1_Click()
  3.     Dim Rng As Range, Ar(1 To 2), i As Integer
  4.     Ar(1) = Array(OptionButton1, OptionButton2, OptionButton3) ', OptionButton4, OptionButton5, OptionButton6....
  5.     Ar(2) = Array(TextBox1, TextBox2, TextBox3, TextBox4, TextBox5) ', TextBox6, TextBox7, TextBox8, TextBox9....
  6.    
  7.     'Join ¨ç¼Æ ¶Ç¦^¤@­Ó¦r¦ê¡A¸Ó¦r¦ê¬O³z¹L³sµ²¬Y­Ó(¤@ºû)°}¦C¤¤ªº¦h­Ó¤l¦r¦ê¦Ó«Ø¥ßªº¡C
  8.     If InStr(UCase(Join(Ar(1), "")), "TRUE") = 0 Or InStr(Join(Ar(2), ","), ",,") Then
  9.         MsgBox ("¸ê®Æ¥¼¿é¤J§¹¾ã¡A ¡y * ¡z ¥²¶·¿é¤J" & vbCrLf & _
  10.         "Data is not enter the full , ¡y * ¡z you must fill ")
  11.         Exit Sub
  12.     End If
  13.     ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  14.     Set Rng = Sheets("FMC Input Database").Range("a" & Rows.Count).End(xlUp).Offset(1)
  15.     With Rng  'ª«¥óRng : ©Ò«ü©wªºÀx¦s®æ©ÎÀx¦s®æ½d³ò¡C(¤£¥²²¾°Ê¤u§@­¶)
  16.         For i = 0 To UBound(Ar(1))
  17.             If Ar(1)(i).Value Then
  18.                 'Caption ÄÝ©Ê ¥X²{¦bª«¥ó¤Wªº­×¹¢¤å¦r , ¤@¯ë¥Î¨Ó¿ëÃѩδy­z¸Óª«¥ó
  19.                 .Value = Ar(1)(i).Caption
  20.                 Exit For
  21.                 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  22.             End If
  23.         Next
  24.         '.Range("B1")->³oRng ªº Àx¦s®æ©ÎÀx¦s®æ½d³ò¡C
  25.         .Range("B1").Resize(, UBound(Ar(2)) + 1) = Ar(2)
  26.         .Range("G1") = Now
  27.         ''''''''''''''''''''''''''''''''''''''''''''
  28.     End With
  29. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  v03586
¸Õ¸Õ¬Ý
GBKEE µoªí©ó 2015-11-16 11:28



    ¤S¦h¾Ç¤@©Û...¾Çµ{¦¡¯uªº¸òÁ¿¸Ü¤@¼Ë
¤@¼Ëµ²ªG, ¦ý¥i¥H¥Î«Ü¦hºØ·N«äªí¹F!!!!! ·PÁ«ü¾É:)

TOP

        ÀR«ä¦Û¦b : ¹D¼w¬O´£ª@¦Û§Úªº©ú¿O¡A¤£¸Ó¬O¨þ¥¸§O¤HªºÃ@¤l¡C
ªð¦^¦Cªí ¤W¤@¥DÃD