Board logo

¼ÐÃD: excel ³ø»ùªí³æ¤W¿é¤J¤£¦PªºItem¦p¦ó±a¤J¤£¦Pªº¹Ï¤ù [¥´¦L¥»­¶]

§@ªÌ: h99949    ®É¶¡: 2014-2-19 08:25     ¼ÐÃD: excel ³ø»ùªí³æ¤W¿é¤J¤£¦PªºItem¦p¦ó±a¤J¤£¦Pªº¹Ï¤ù

½Ð°Ý¦U¦ì°ª¤â,§Ú¦bexcel ªí³æ¤Wªº¹Ï¤ù(Image)
·Q¨Ì·Óªí³æ¤W¿é¤J¤£¦PªºItem±a¤J¤£¦Pªº¹Ï¤ù(¹Ï¤ùÀx¦s¦bD:\catalogue¸Ì)
µ{¦¡½XÀ³¸Ó­n«ç»ò¼g??
§@ªÌ: GBKEE    ®É¶¡: 2014-2-19 09:49

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-2-19 14:35 ½s¿è

¦^´_ 1# h99949
  1. Const ¹w³]·Ó¤ùºô§} = "http://blog-imgs-27-origin.fc2.com/p/o/k/pokomin/TOTAL.jpg"
  2. Const ¹w³]·Ó¤ù = "d:\·Ó¤ù.gif"
  3. Private Sub UserForm_Initialize()  '¶}±Òªí³æªì©lµ{¦¡
  4.     ¤U¸üºô¸ô¹Ï¤ù
  5.      With Image1
  6.         .Picture = LoadPicture(¹w³]·Ó¤ù)          '¸ü¤J¹Ï¤ù
  7.         .PictureSizeMode = fmPictureSizeModeZoom  '¹Ï¤ù¼Ò¦¡
  8.      End With
  9.      TextBox1.SetFocus
  10. End Sub
  11. Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) 'ªí³æÃö³¬
  12.     Kill ¹w³]·Ó¤ù '§R°£
  13. End Sub
  14. Private Sub TextBox1_Change()
  15.     If TextBox1.Value = "" Then Exit Sub
  16.     Dim cell As Range
  17.     Set cell = Sheets("ÂøµæÁç").Columns(1).Find(TextBox1.Value, lookat:=xlWhole)
  18.     If Not cell Is Nothing Then
  19.         If Dir("D:\catalogue\" & cell & ".*") <> "" Then
  20.             Image1.Picture = LoadPicture("d:\catalogue\" & Dir("D:\catalogue\" & cell & ".*"))
  21.         End If
  22.         TextBox2.Value = cell.Offset(, 1).Value
  23.         TextBox3.Value = cell.Offset(, 2).Value
  24.         TextBox4.Value = cell.Offset(, 3).Value
  25.         TextBox5.Value = cell.Offset(, 4).Value
  26.         TextBox6.Value = cell.Offset(, 5).Value
  27.         TextBox7.Value = cell.Offset(, 32).Value
  28.         TextBox8.Value = cell.Offset(, 33).Value
  29.     Else
  30.        Image1.Picture = LoadPicture(¹w³]·Ó¤ù)
  31.         TextBox2.Value = ""
  32.         TextBox3.Value = ""
  33.         TextBox4.Value = ""
  34.         TextBox5.Value = ""
  35.         TextBox6.Value = ""
  36.         TextBox7.Value = ""
  37.         TextBox8.Value = ""
  38.     End If
  39. End Sub
  40. Private Sub TextBox1_AfterUpdate()
  41.     If TextBox2.Value = "" Then
  42.         TextBox2.SetFocus
  43.     Else
  44.         CommandButton2.SetFocus
  45.     End If
  46. End Sub
  47. Private Sub ¤U¸üºô¸ô¹Ï¤ù()
  48.     Dim xml As Object     '¥Î¨Ó¨ú±oºô­¶¸ê®Æ
  49.     Dim stream            'As ADODB.stream   '¥Î¨ÓÀx¦s¤G¶i¦ìÀÉ®×
  50.     Set xml = CreateObject("Microsoft.XMLHTTP")
  51.     Set stream = CreateObject("ADODB.stream")
  52.         xml.Open "GET", ¹w³]·Ó¤ùºô§}, 0
  53.         xml.send
  54.     With stream
  55.         .Open
  56.         .Type = 1
  57.         .write xml.ResponseBody
  58.         If Dir(¹w³]·Ó¤ù) <> "" Then Kill ¹w³]·Ó¤ù
  59.         .SaveToFile (¹w³]·Ó¤ù)
  60.         .Close
  61.     End With
  62.     Set xml = Nothing
  63.     Set stream = Nothing
  64. End Sub
½Æ»s¥N½X

§@ªÌ: h99949    ®É¶¡: 2014-2-19 13:11

§A¦n,¹Ï¤ù¬O©ñ¦b¹q¸£ªºD:\catalogue¸Ì¨Ã¤£¬Oºô§}¸Ì,½Ð°Ýµ{¦¡¸Ó¦p¦ó­×§ï?
§@ªÌ: h99949    ®É¶¡: 2014-2-19 13:17

¹Ï¤ù¤£¬O©T©wªº¥¦¬O¥i¥H¨Ì¿é¤Jªº¸ê®Æ¤£¦P§@ÅܤÆ
§@ªÌ: h99949    ®É¶¡: 2014-2-19 13:45

¦^´_ 2# GBKEE
¥i¥H±N¹w³]ªº·Ó¤ù§ï¦¨¹q¸£¸Ìªº¹Ï¤ù¶Ü?
§@ªÌ: GBKEE    ®É¶¡: 2014-2-19 14:05

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-2-19 14:37 ½s¿è

¦^´_ 5# h99949
¹Ï¤ù¬O©ñ¦b¹q¸£ªºD:\catalogue¸Ì¨Ã¤£¬Oºô§}¸Ì,½Ð°Ýµ{¦¡¸Ó¦p¦ó­×§ï?
¹Ï¤ù¤£¬O©T©wªº¥¦¬O¥i¥H¨Ì¿é¤Jªº¸ê®Æ¤£¦P§@ÅܤÆ
¥i¥H±N¹w³]ªº·Ó¤ù§ï¦¨¹q¸£¸Ìªº¹Ï¤ù¶Ü?
  1. Const ¹w³]·Ó¤ù = "d:\·Ó¤ù.gif"  '³o¤£¬O¹q¸£¸Ìªº¹Ï¤ù¶Ü
  2. Private Sub TextBox1_Change()
  3.     If TextBox1.Value = "" Then Exit Sub
  4.     Dim cell As Range
  5.     Set cell = Sheets("ÂøµæÁç").Columns(1).Find(TextBox1.Value, lookat:=xlWhole)
  6.     If Not cell Is Nothing Then  
  7.         If Dir("D:\catalogue\" & cell & ".*") <> "" Then  
  8.              '*** ¦b¹q¸£ªºD:\ ¤w§ó¥¿ D:\catalogue     ******
  9.             ' *** ¨Ì TextBox1.Value ¦³ÅÜ¤Æ ******
  10.             Image1.Picture = LoadPicture("d:\catalogue\" & Dir("D:\catalogue\" & cell & ".*"))
  11.             'TextBox1.Value-> "d:\catalogue\" & Dir("D:\catalogue\" & cell & ".*")
  12.         End If
  13.     Else
  14.        Image1.Picture = LoadPicture(¹w³]·Ó¤ù)
  15.      End If
½Æ»s¥N½X

§@ªÌ: h99949    ®É¶¡: 2014-2-20 22:48

¦^´_ 6# GBKEE
ª©¥D§A¦n,¤w¸g¥H¥Î¤F,ÁÂÁÂ
¦ý§Ú·Q¦bªí³æ¿é¤JItem«á±a¥X¨Óªº¬ÛÃö¸ê®Æ,¥i¥H¦bªí³æ¤W­×§ï«áª½±µÀx¦s¨ì¬Û¹ïÀ³ªºÀx¦s®æ¤W,µ{¦¡À³¸Ó¦p¦ó°µ­×§ï©O?
§@ªÌ: GBKEE    ®É¶¡: 2014-2-21 10:15

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-2-21 13:57 ½s¿è

¦^´_ 7# h99949
  1. Option Explicit         '±j¨î«Å§iÅܼÆ
  2. Option Base 1           '°}¦Cªº¯Á¤Þ­È,«ü©w¤U­­­È¬° 1
  3. Const ¹w³]·Ó¤ùºô§} = "http://blog-imgs-27-origin.fc2.com/p/o/k/pokomin/TOTAL.jpg" '«ü©w±`¼Æ
  4. Const ¹w³]·Ó¤ù = "d:\·Ó¤ù.gif"
  5. Dim Rng As Range, Text_Ar(), AR(), Rng_Text As String

  6. Private Sub UserForm_Initialize()   '¶}±Òªí³æªì©lµ{¦¡
  7.     Dim i As Integer
  8.     For i = 1 To 7
  9.         ReDim Preserve Text_Ar(1 To i)
  10.         Set Text_Ar(i) = Me.Controls("TextBox" & i + 1) '±N±±¨î¶µ"TextBox?" ¸m¤J°}¦C¤¤
  11.     Next
  12.     AR = Array(1, 2, 3, 4, 5, 32, 33)   '³f¸¹¸ê®Æªº¦ì¸m
  13.     TextBox1.SetFocus
  14.     ¤U¸üºô¸ô¹Ï¤ù
  15.     With Image1
  16.         .Picture = LoadPicture(¹w³]·Ó¤ù)          '¸ü¤J¹Ï¤ù
  17.         .PictureSizeMode = fmPictureSizeModeZoom  '¹Ï¤ù¼Ò¦¡
  18.     End With
  19. End Sub

  20. Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) 'ªí³æÃö³¬
  21.     Kill ¹w³]·Ó¤ù '§R°£
  22. End Sub

  23. Private Sub TextBox1_Change()
  24.     Dim i As Integer
  25.     If TextBox1.Value = "" Then Exit Sub
  26.     Set Rng = Sheets("ÂøµæÁç").Columns(1).Find(TextBox1.Value, lookat:=xlWhole)
  27.     If Not Rng Is Nothing Then
  28.         If Dir("D:\catalogue\" & Rng & ".*") <> "" Then
  29.            Image1.Picture = LoadPicture("d:\catalogue\" & Dir("D:\catalogue\" & Rng & ".*"))
  30.         End If
  31.         Rng_Text = ""                                              '²M°£ °O¾Ð¸ê®Æ
  32.         For i = 1 To UBound(AR)
  33.             Rng_Text = Rng_Text & Rng.Offset(, AR(i))   '°O¾Ð¸ê®Æ
  34.             Text_Ar(i).Text = Rng.Offset(, AR(i)).Value '¾É¤J¸ê®Æ¦bTextBox?
  35.             'Rng.Offset(, i).Text  :Àx¦s®æÅã¥Üªº¼Æ¦r®æ¦¡
  36.             'Rng.Offset(, i).Value :Àx¦s®æ¯u¥¿ªº¼Æ¦r
  37.             'Åã¥Üªº¼Æ¦r®æ¦¡,¤£¤@©wµ¥©ó,¯u¥¿ªº¼Æ¦r.
  38.         Next
  39.     Else
  40.        Image1.Picture = LoadPicture(¹w³]·Ó¤ù)
  41.         For i = 1 To UBound(AR)
  42.             Text_Ar(i).Text = ""
  43.         Next
  44.     End If
  45. End Sub

  46. Private Sub TextBox1_AfterUpdate()
  47.     If TextBox2.Value = "" Then
  48.         TextBox2.SetFocus
  49.     Else
  50.         CommandButton2.SetFocus
  51.     End If
  52. End Sub

  53. Private Sub CommandButton1_Click()
  54.     Dim s As String, i As Integer
  55.     If Rng Is Nothing Then
  56.         s = "³f¸¹¤¤¨S¦³ " & TextBox1
  57.     ElseIf Rng_Text = Join(Text_Ar, "") Then
  58.         s = "³f¸¹" & TextBox1 & "¸ê®Æ¨S¦³­×§ï !!"
  59.     End If
  60.     If s = "" Then
  61.         If MsgBox(TextBox1 & "­×§ï¸ê®Æ !!", 32 + vbYesNo) = vbYes Then
  62.             For i = 1 To UBound(AR)
  63.                 Rng.Offset(, AR(i)).Value = Text_Ar(i) '¾É¤JTextBox?¼Æ¦r(¤å¦r«¬ºA)¨ìRng
  64.                 Rng.EntireRow = Rng.EntireRow.Value '¼Æ¦r(¤å¦r«¬ºA)Âର ¼Æ¦r(¼Æ¦r«¬ºA)
  65.             Next
  66.         End If
  67.     End If
  68. End Sub

  69. Private Sub ¤U¸üºô¸ô¹Ï¤ù()
  70.     Dim xml As Object     '¥Î¨Ó¨ú±oºô­¶¸ê®Æ
  71.     Dim stream            'As ADODB.stream   '¥Î¨ÓÀx¦s¤G¶i¦ìÀÉ®×
  72.     Set xml = CreateObject("Microsoft.XMLHTTP")
  73.     Set stream = CreateObject("ADODB.stream")
  74.         xml.Open "GET", ¹w³]·Ó¤ùºô§}, 0
  75.         xml.send
  76.     With stream
  77.         .Open
  78.         .Type = 1
  79.         .write xml.ResponseBody
  80.         If Dir(¹w³]·Ó¤ù) <> "" Then Kill ¹w³]·Ó¤ù
  81.         .SaveToFile (¹w³]·Ó¤ù)
  82.         .Close
  83.     End With
  84.     Set xml = Nothing
  85.     Set stream = Nothing
  86. End Sub

  87. Private Sub cal_Click()
  88.     Dim x As Integer, y As Integer, s As String
  89.     x = Val(mypv)                       '³æ»ù
  90.     y = Val(myrate)
  91.     If y <> 0 Then s = Round(x / y, 2)  '¶×²v
  92.     ratepay.Caption = s
  93. End Sub
½Æ»s¥N½X

§@ªÌ: h99949    ®É¶¡: 2014-2-21 10:49

¦^´_ 8# GBKEE
Private Sub TextBox1_Change()Åܼƥ¼©w¸q¸Ó¦p¦ó­×§ï
§@ªÌ: GBKEE    ®É¶¡: 2014-2-21 11:02

¦^´_ 9# h99949
  1. Option Explicit         '±j¨î«Å§iÅܼÆ
  2. Option Base 1           '°}¦Cªº¯Á¤Þ­È,«ü©w¤U­­­È¬° 1
  3. Const ¹w³]·Ó¤ùºô§} = "http://blog-imgs-27-origin.fc2.com/p/o/k/pokomin/TOTAL.jpg" '«ü©w±`¼Æ
  4. Const ¹w³]·Ó¤ù = "d:\·Ó¤ù.gif"
  5. Dim Rng As Range, Text_Ar(), AR(), Rng_Text As String  '³o¸Ì¦³¶Ü?
½Æ»s¥N½X

§@ªÌ: h99949    ®É¶¡: 2014-2-21 11:24

¦^´_ 10# GBKEE


    Dim Rng As Range, Text_Ar(), AR(), Rng_Text As String¦³³o­Ó
§@ªÌ: h99949    ®É¶¡: 2014-2-21 13:19

¦^´_ 10# GBKEE
§@ªÌ: GBKEE    ®É¶¡: 2014-2-21 13:56

¦^´_ 12# h99949
cell §ï¦¨ Rng
§@ªÌ: h99949    ®É¶¡: 2014-2-21 14:23

¦^´_ 13# GBKEE


    ok¤F,ÁÂÁª©¥D
§@ªÌ: h99949    ®É¶¡: 2014-2-21 14:43

¦^´_ 13# GBKEE


ª©¥D,¦b½Ð°Ý¤@¤U,¦bÅã¥Ü®æ¥X²{ªº¼Æ¦rªº®æ¦¡­nÅã¥Ü¦¨¦³¤d¤À¦ì(,)ÂIªº®æ¬O­n¦b­þ¸Ì°µ­×§ï
¦C¦p20000Åܦ¨20,000
§@ªÌ: GBKEE    ®É¶¡: 2014-2-21 14:54

¦^´_ 15# h99949
  1. Private Sub CommandButton1_Click()
  2.     Dim s As String, i As Integer
  3.     If Rng Is Nothing Then
  4.         s = "³f¸¹¤¤¨S¦³ " & TextBox1
  5.     ElseIf Rng_Text = Join(Text_Ar, "") Then
  6.         s = "³f¸¹" & TextBox1 & "¸ê®Æ¨S¦³­×§ï !!"
  7.     End If
  8.     If s = "" Then
  9.         If MsgBox(TextBox1 & "­×§ï¸ê®Æ !!", 32 + vbYesNo) = vbYes Then
  10.             For i = 1 To UBound(AR)
  11.                 With Rng.Offset(, AR(i))
  12.                     .Value = Text_Ar(i) '¾É¤JTextBox?¼Æ¦r(¤å¦r«¬ºA)¨ìRng
  13.                     .Value = .Value
  14.                     .NumberFormatLocal = "#,##0.00_ "
  15.                 End With
  16.             Next
  17.         End If
  18.     End If
  19. End Sub
½Æ»s¥N½X

§@ªÌ: h99949    ®É¶¡: 2014-2-21 16:07

¦^´_ 16# GBKEE


    ¥i¥H¤F,ÁÂÁÂ
§@ªÌ: h99949    ®É¶¡: 2014-2-21 17:47

¦^´_ 16# GBKEE


ª©¥D,½Ð°Ý§Ú¦bªí³æ¤W­×§ï«áª½±µÀx¦s¨ì¬Û¹ïÀ³ªºÀx¦s®æ®É,¦pªG­n¦b¤£¼vÅT¨ìFOB-¬üª÷,FOB-¼Ú¤¸,Á`»ù,20§`Âd,40§`Âd¤º­ì¥»ªººâ­p¤½¦¡®É,¨Ã¯à§Y®ÉÅã¥Ü­×§ï«á­pºâªºµ²ªG®É
µ{¦¡¸Ó¦p¦ó­×§ï
§@ªÌ: GBKEE    ®É¶¡: 2014-2-25 16:43

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-2-26 14:43 ½s¿è

¦^´_ 18# h99949
§¹¾ãª©ªº¸ê®Æ [·s¼W],[­×¥¿],[§R°£] «öÁä
§ä¤£¸ô®|®É­×§ï  Const ¹w³]·Ó¤ù = "D:\«È¤á³ø»ù³æ\catalogue\GEIST.gif"


[attach]17599[/attach]
§@ªÌ: h99949    ®É¶¡: 2014-2-26 12:44

¦^´_ 19# GBKEE


ª©¥D¤£¦n·N«ä,Á`»ùÀ³¸Ó=(J:AA)ªº¥[Á`
                               °l¥[Äæ¦ì¤u®É=30000*10/20/1000*D/C
µ{¦¡½XÀ³¸Ó¦b­þùحקï
¸Õ¥Î«á¦pªG³f¸¹±q11­Ó§R¨ì²Ä2­Ó®É·|¥X²{µLªk³]©wListÄݩʸӦp¦ó­×§ï
§@ªÌ: GBKEE    ®É¶¡: 2014-2-26 14:48

¦^´_ 20# h99949
µLªk³]©wListÄÝ©Ê
  1. Private Sub Item_List()   '«Ø¥ßComboBox1ªºList
  2.     Dim AR
  3.     Set Sh = Sheets("ÂøµæÁç")
  4.     With Sh
  5.         If .Range("a1").End(xlDown).Row = .Rows.Count Then
  6.             ComboBox1.Clear
  7.         Else
  8.             AR = .Range("a2:a" & .Range("a1").End(xlDown).Row).Value
  9.             If .Range("a1").End(xlDown).Row = 2 Then AR = Array(AR)
  10.             ComboBox1.List = AR
  11.         End If
  12.     End With
  13. End Sub
½Æ»s¥N½X
°l¥[Äæ¦ì¤u®É=30000*10/20/1000*D/C
  1. Option Explicit  'ª«¥ó¼Ò²Õµ{¦¡½X
  2. Public WithEvents Text_A As MSForms.TextBox
  3. Public WithEvents Text_B As MSForms.TextBox
  4. Private Sub Text_A_Change()
  5.     Dim S As Integer
  6.     With Text_A
  7.          With .Parent
  8.             '°l¥[Äæ¦ì¤u®É = 30000 * 10 / 20 / 1000 * D / C
  9.             If IsNumeric(.TextBox3) And IsNumeric(.TextBox4) Then
  10.                
  11.                 S = CLng(30000) * 10 / 20 / 1000 * .TextBox4 / .TextBox3
  12.                 .TextBox27 = Application.WorksheetFunction.Round(S, 2)
  13.             Else
  14.                 .TextBox27 = ""
  15.             End If
  16.         End With
  17.         '******************************************
  18.         S = Val(Replace(UCase(.Name), "TEXTBOX", ""))
  19.         If (IsNumeric(.text) And Val(.text) > 0) Or (.Name = "TextBox2" And Trim(.text) <> "") Then
  20.             Select Case S
  21.                 Case 2 To 4
  22.                      .BackColor = &HE0E0E0
  23.                 Case Else
  24.                     .BackColor = vbYellow
  25.             End Select
  26.         Else
  27.             .BackColor = vbRed
  28.         End If
  29.         If .Parent.Msg Then .Parent.¨¾§b
  30.     End With
  31. End Sub
  32. Private Sub Text_B_Change()   'Á`»ùªº¥[Á`
  33.     Dim i As Integer, S
  34.     With Text_B
  35.         For i = 8 To 27  '****'°l¥[Äæ¦ì¤u®É
  36.             If IsNumeric(.Parent.Controls("TextBox" & i)) Or Trim(.Parent.Controls("TextBox" & i)) = "" Then
  37.                 S = S + Val(.Parent.Controls("TextBox" & i))
  38.             End If
  39.         Next
  40.         .Parent.TextBox7 = IIf(S = 0, "", Int(S))
  41.         If IsNumeric(.text) Or Trim(.text) = "" Then
  42.             .BackColor = &HE0E0E0
  43.         Else
  44.             .BackColor = vbRed
  45.         End If
  46.        If .Parent.Msg Then .Parent.¨¾§b
  47.     End With
  48. End Sub
½Æ»s¥N½X

§@ªÌ: h99949    ®É¶¡: 2014-2-26 15:30

¦^´_ 21# GBKEE

ª©¥D§A¦n,§ÚFOB¬üª÷ªº´«ºâ·Q§ï¦¨=ROUND(Á`»ù/¬üª÷¶×²v/¤ò§Q²v(°l¥[TextBox38),2)
                                ¼Ú¤¸ªº´«ºâ·Q§ï¦¨=ROUND(Á`»ù/¼Ú¤¸¶×²v/¤ò§Q²v(°l¥[TextBox38),2)        
¤U­±ªºµ{¦¡­n¦p¦ó°l¥[¤ò§Q²v(°l¥[TextBox38)³o¦UÄæ¦ì
Private Sub TextBox7_Change()    'Á`»ù
    If Val(Trim(TextBox7)) <> 0 Then
        If Val(Trim(TextBox5)) <> 0 And Val(Trim(TextBox36)) = 0 Then TextBox36 = Application.WorksheetFunction.Round(TextBox7 / TextBox5, 2)
                                                                                '=ROUND(Á`»ù/¬üª÷¶×²v/¤ò§Q²v(°l¥[),2)
        If Val(Trim(TextBox6)) <> 0 And Val(Trim(TextBox37)) = 0 Then TextBox37 = Application.WorksheetFunction.Round(TextBox7 / TextBox6, 2)
                                                                                '=ROUND(Á`»ù/¬üª÷¶×²v/¤ò§Q²v(°l¥[),2)
        If Val(Trim(TextBox36)) <> 0 Then TextBox5 = Application.WorksheetFunction.Round(TextBox7 / TextBox36, 2) 'Á`»ù*¬ü¤¸¶×²v
        If Val(Trim(TextBox37)) <> 0 Then TextBox6 = Application.WorksheetFunction.Round(TextBox7 / TextBox37, 2) 'Á`»ù*¼Ú¤¸¶×²v
    ElseIf Val(Trim(TextBox7)) = 0 Then
        TextBox5 = ""
        TextBox6 = ""
    End If
    If Msg Then ¨¾§b
End Sub
Private Sub TextBox36_Change()
    If Val(Trim(TextBox7)) <> 0 And Val(Trim(TextBox36)) <> 0 Then
        TextBox5 = Application.WorksheetFunction.Round(TextBox7 / TextBox36, 2)
        '=ROUND(G2/30,2)
    ElseIf Val(Trim(TextBox7)) <> 0 And Val(Trim(TextBox5)) <> 0 Then
        TextBox5 = TextBox7
    End If
End Sub
Private Sub TextBox37_Change()
    If Val(Trim(TextBox7)) <> 0 And Val(Trim(TextBox37)) <> 0 Then
        TextBox6 = Application.WorksheetFunction.Round(TextBox7 / TextBox37, 2)
        '=ROUND(G2/40,2)
    ElseIf Val(Trim(TextBox7)) <> 0 And Val(Trim(TextBox6)) <> 0 Then
        TextBox6 = TextBox7
    End If
End Sub
§@ªÌ: h99949    ®É¶¡: 2014-2-26 15:34

¦^´_ 21# GBKEE


    ªþ¤WÀÉ®×
§@ªÌ: h99949    ®É¶¡: 2014-2-26 18:45

¦^´_ 21# GBKEE

ª©¥D§A¦n,¦b·s¼WITEM®É¥u¯à¥´¼Æ¦r·s¼W,§ï¦¨¤å¦r®É´N¤£¯à·s¼W
³o­n¦p¦ó­×§ï???
§@ªÌ: GBKEE    ®É¶¡: 2014-2-27 06:48

¦^´_ 24# h99949
·s¼WITEM ¦³³W«h¶Ü?
§@ªÌ: h99949    ®É¶¡: 2014-2-27 09:28

¦^´_ 25# GBKEE


    Sub ¨¾§b()  '­nµ¹ª«¥óÃþ§O¼Ò²Õ©I¥s,¤£¥i¥Î Private
    Dim A As Variant, i As Integer, Rng As Range, AR(1 To 2)
    CommandButton1.Enabled = False          '¤£¥i·s¼W
    CommandButton2.Enabled = False          '¤£¥i­×§ï
    CommandButton3.Enabled = False          '¤£¥i§R°£
    A = Application.Match(Val(ComboBox1), Application.Transpose(ComboBox1.List), 0)
    If (IsNumeric(A) And ComboBox1.ListIndex = -1) Or ComboBox1.ListIndex > -1 Then
        CommandButton3.Enabled = True       '¥i¥H§R°£
    End If
    For i = 2 To 35
        If i <= 33 Then
            If i <= 7 Then AR(1) = AR(1) & "," & Trim(Controls("TextBox" & i))
            'Ar(1): °O¿ý -> Description,½c,Cuft,FOB-¬üª÷,FOB-¼Ú¤¸,Á`»ù'¦bªí³æªº¸ê®Æ
            If Controls("TextBox" & i).BackColor = vbRed Then
                CommandButton1.Enabled = False      '¤£¥i·s¼W
                CommandButton2.Enabled = False      '¤£¥i­×§ï
                Exit Sub                            'Â÷¶} [¨¾§b]³oµ{¦¡
            End If
        End If
        If IsNumeric(A) Then AR(2) = AR(2) & Trim(Controls("TextBox" & i))  'Ar(2): °O¿ý -> ªí³æªº©Ò¦³¸ê®Æ
    Next
    If IsError(A) And IsNumeric(Trim(ComboBox1)) And InStr(AR(1) & ",", ",,") = 0 Then CommandButton1.Enabled = True ¬O±q³o¸Ì§ï¶Ü?
                    'IsError(A) :Trim(ComboBox1 ¤£¦b ComboBox1.LIST ¤¤, ¥i¥H·s¼W
                    'IsNumeric(Trim(ComboBox1)) µø¼Æ¦r                , ¥i¥H·s¼W
                    'InStr(Ar(1) & ",", ",,") = 0 ->¨S¦³ªÅ¥Õ          , ¥i¥H·s¼W
    If IsNumeric(A) And Msg_Data <> AR(2) Then CommandButton2.Enabled = True '¥i¥H­×§ï
End Sub
§@ªÌ: h99949    ®É¶¡: 2014-2-27 14:31

¦^´_ 25# GBKEE


ª©¥D§A¦n,§Ú±NIsNumeric (Àˬd¬O§_¬°¼Æ¦r)§ï IsText³o¼Ë¤£¹ï¶Ü

If IsError(A) And IsText(Trim(ComboBox1)) And InStr(AR(1) & ",", ",,") = 0 Then CommandButton1.Enabled = True
§@ªÌ: GBKEE    ®É¶¡: 2014-2-27 15:00

¦^´_ 27# h99949

¨S¦³IsText ³o¨ç¼Æ
Trim() :²M°£«e«áªºªÅ¥Õ¦r¦ê
Trim(ComboBox1)<>"" -> ¦³¦r¦ê
  1. If IsError(A) And Trim(ComboBox1)<>"" And InStr(AR(1) & ",", ",,") = 0 Then CommandButton1.Enabled = True
½Æ»s¥N½X

§@ªÌ: h99949    ®É¶¡: 2014-2-27 16:28

¦^´_ 28# GBKEE

ª©¥D§A¦n,§ÚFOB¬üª÷ªº´«ºâ·Q§ï¦¨=ROUND(Á`»ù/¬üª÷¶×²v/¤ò§Q²v(°l¥[TextBox38),2)
                                ¼Ú¤¸ªº´«ºâ·Q§ï¦¨=ROUND(Á`»ù/¼Ú¤¸¶×²v/¤ò§Q²v(°l¥[TextBox38),2)        
¤U­±µ{¦¡­×§ï¦¨³o¼Ë¹ï¶Ü?
Private Sub TextBox7_Change()    'Á`»ù
    If Val(Trim(TextBox7)) <> 0 Then
        If Val(Trim(TextBox5)) <> 0 And Val(Trim(TextBox36)) = 0 And Val(Trim(TextBox38)) <> 0 Then TextBox36 = Application.WorksheetFunction.Round(TextBox7 / TextBox5 / TextBox38, 2)
        If Val(Trim(TextBox5)) <> 0 And Val(Trim(TextBox36)) = 0 And Val(Trim(TextBox38)) <> 0 Then TextBox38 = Application.WorksheetFunction.Round(TextBox7 / TextBox5 / TextBox38, 2)
                                                                                '=ROUND(Á`»ù/¬ü¤¸¶×²v/¤ò§Q²v,2)
        If Val(Trim(TextBox6)) <> 0 And Val(Trim(TextBox37)) = 0 And Val(Trim(TextBox38)) <> 0 Then TextBox37 = Application.WorksheetFunction.Round(TextBox7 / TextBox6 / TextBox38, 2)
        If Val(Trim(TextBox6)) <> 0 And Val(Trim(TextBox37)) = 0 And Val(Trim(TextBox38)) <> 0 Then TextBox38 = Application.WorksheetFunction.Round(TextBox7 / TextBox6 / TextBox38, 2)
                                                                                '=ROUND(Á`»ù/¼Ú¤¸¶×²v/¤ò§Q²v,2)

        
        
        If Val(Trim(TextBox36)) <> 0 Then TextBox5 = Application.WorksheetFunction.Round(TextBox7 / TextBox36 / TextBox38, 2) 'Á`»ù*¬ü¤¸¶×²v*¤ò§Q²v
        If Val(Trim(TextBox38)) <> 0 Then TextBox5 = Application.WorksheetFunction.Round(TextBox7 / TextBox36 / TextBox38, 2) 'Á`»ù*¬ü¤¸¶×²v*¤ò§Q²v
        
        If Val(Trim(TextBox37)) <> 0 Then TextBox6 = Application.WorksheetFunction.Round(TextBox7 / TextBox37 / TextBox38, 2) 'Á`»ù*¼Ú¤¸¶×²v*¤ò§Q²v
        If Val(Trim(TextBox38)) <> 0 Then TextBox6 = Application.WorksheetFunction.Round(TextBox7 / TextBox37 / TextBox38, 2) 'Á`»ù*¼Ú¤¸¶×²v*¤ò§Q²v
     
    ElseIf Val(Trim(TextBox7)) = 0 Then
        TextBox5 = ""
        TextBox6 = ""
    End If
    If Msg Then ¨¾§b
End Sub
Private Sub TextBox36_Change()
    If Val(Trim(TextBox7)) <> 0 And Val(Trim(TextBox36)) <> 0 Then
        TextBox5 = Application.WorksheetFunction.Round(TextBox7 / TextBox36, 2)
        '=ROUND(Á`»ù/¬ü¤¸¶×²v/¤ò§Q²v,2)
    ElseIf Val(Trim(TextBox7)) <> 0 And Val(Trim(TextBox5)) <> 0 Then
        TextBox5 = TextBox7
    End If
End Sub
Private Sub TextBox37_Change()
    If Val(Trim(TextBox7)) <> 0 And Val(Trim(TextBox37)) <> 0 Then
        TextBox6 = Application.WorksheetFunction.Round(TextBox7 / TextBox37, 2)
        '=ROUND(Á`»ù/¼Ú¤¸¶×²v/¤ò§Q²v,2)
    ElseIf Val(Trim(TextBox7)) <> 0 And Val(Trim(TextBox6)) <> 0 Then
        TextBox6 = TextBox7
    End If
End Sub
Private Sub TextBox38_Change()
    If Val(Trim(TextBox7)) <> 0 And Val(Trim(TextBox36)) <> 0 And Val(Trim(TextBox38)) <> 0 Then
        TextBox5 = Application.WorksheetFunction.Round(TextBox7 / TextBox36 / TextBox38, 2)
        '=ROUND(Á`»ù/¬ü¤¸¶×²v/¤ò§Q²v,2)
    ElseIf Val(Trim(TextBox7)) <> 0 And Val(Trim(TextBox5)) <> 0 Then
        TextBox5 = TextBox7
    End If
    If Val(Trim(TextBox7)) <> 0 And Val(Trim(TextBox37)) <> 0 And Val(Trim(TextBox38)) <> 0 Then
        TextBox6 = Application.WorksheetFunction.Round(TextBox7 / TextBox37 / TextBox38, 2)
        '=ROUND(Á`»ù/¼Ú¤¸¶×²v/¤ò§Q²v,2)
    ElseIf Val(Trim(TextBox7)) <> 0 And Val(Trim(TextBox6)) <> 0 Then
        TextBox6 = TextBox7
    End If
End Sub




Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)