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

[µo°Ý] VBA¤U©Ô¦¡¿ï³æ(¤w¸Ñ¨M)

[µo°Ý] VBA¤U©Ô¦¡¿ï³æ(¤w¸Ñ¨M)

¥»©«³Ì«á¥Ñ arcticfox ©ó 2011-5-19 17:27 ½s¿è

¦U¦ì¤j¤j¤È¦w@@"
³o¦¸¤S¦³¤@­Ó¤p°ÝÃD

¦p¤U¹Ï, §Ú³]­p¤F¤@­Ó«È¤áºÞ²zªí, ¤£¹L§Ú§Æ±æ¤§«á©Ò¦³¹ï¸Ü®Øªº¤U©Ô¦¡¿ï³æ"Company"¥i¥H¤Þ¥Î¸Óªí®æªº«È¤áÄæ¦ì


·N«ä´N¬O»¡, ¥¼¨Ó·s¼Wªº«È¤á¸ê®Æ, ¨ä¤¤«È¤áªº¦W¦r¥i¥H³Q¤Þ¥Î¨ì¤U©Ô¦¡¿ï³æ¸Ì­±, ¦p¤U¹Ï

¦]¬°§Ú¥u·|¥Î¼g

Private Sub UserForm_Initialize()

Pro_Statu.Combo_Cus.List = Array("xxxx", "xxxx") ¤§Ãþªº

End Sub

¤£¾å±o¬O§_¦³¤°»ò¤èªk¥i¸Ñ¨M¦¹°ÝÃD? ¦A³Â·Ð¦U¦ì¤j¤j«ü¾É, ÁÂÁÂ^^

¦n, ÁÂÁ¤j¤j
§Ú¥ý¸Õ¸Õ¬Ý^^

TOP

¦^´_ 4# Hsieh

3Q¨â¦ì¤j¤jªº«ü¾É, ¤£¹L³£¨S¥Î¥X¨ÓT_T
ª©¥D·N«ä¬O»¡¹³¤U­±¤@¼Ë, ¼gªk¶Ü


¤£¹L¥L¤£Åý§Ú³]©wÄÝ©Ê, µL®ÄªºÄݩʪ½
§Úª½±µ¦bRowSource¥´ Cus_List


·Q½Ð°Ý¬O­þ­ÓÀô¸`·d¿ù©O??

TOP

«z«¨~~«ç»ò©M§Ú·Qªº§¹¥þ¤£¤@¼Ë=.=
§Ú¥ý¸Õ¸Õ¬Ý
ªGµM¥Î·Qªº³£¤ñ¹ê»Ú¤U¥h§ËÁÙ²³æ
¹q¸£¤Ó²Â  ÁÙ¬O§Ú¤Ó²ÂXD

3Q¦U¦ì¤j¤j

TOP

¥»©«³Ì«á¥Ñ arcticfox ©ó 2011-5-17 14:34 ½s¿è

¦^´_ 6# chin15


   ¤@­Ó¤p°ÝÃD
§Ú±N¤j¤jªºµ{¦¡½X§ï¼g¦p¤U:


Private Sub UserForm_Initialize()

Dim i%

i = Range("A65536").End(xlUp).Row
Pro_Statu.Combo_Cus.List = Worksheets("«È¤á¸ê®ÆºÞ²z").Range("A1:A" & i).Value

End Sub
¤£¹LÁ`¬O·|¥X²{, °õ¦æ¶¥¬q¿ù»~381 - µLªk³]©wListÄÝ©Ê. ÄÝ©Ê°}¦C¤Þ¯Á¤£¥¿½T

©Ò¥H§Ú­«·s§â¾ã¬qµ{¦¡½Æ»s¶i¥h
¨Ã¥u§ï¼g¤Fcombobox1¨º­Ó³¡¤À

«o±o¨ì : °õ¦æ¶¥¬q¿ù»~424 - ¦¹³B»Ý­nª«¥ó

TOP

¥»©«³Ì«á¥Ñ arcticfox ©ó 2011-5-17 15:11 ½s¿è

¦^´_ 9# Hsieh


»Å!!  3Q ª©¤j :'(

¤£·Q¦A¦h¼W¥[ª©­±
¦b¤@¦¸3Q¦U¦ì¤j¤j
§Ú²×©ó·d©w­ùXD
µ¥ºN¼ô¦A¨ÓºCºC¸Õ¸Õ¬Ý¦Û¤v¥Î¼gªº¤è¦¡
:lol

TOP

¦^´_ 9# Hsieh

§Ú·QÄ~Äò©µÄò¤W¦¸ª©¥D»¡ªº¸Ñ¨M¿ìªk
¤£¹L­n¥ýÁÂÁª©¥D, §Ú²×©óª¾¹D"¦WºÙºÞ²z"ªº¥\¥Î(2010)

¥t¤@­Ó¤pºÃ°Ý¦b©ó, §Ú¬O§_¥i¥Hª½±µ¦bVBAªº¼Ò²Õ¸Ìª½±µ¤Þ¥Î³o¨Ç³]©w©O?
¦pªG­n¤Þ¥Î³o¨Ç³]©w, À³¸Ó­n¥Î¤°»ò¤è¦¡¥h°µ¤Þ¥Î


§Ú¦³¸Õ¹L»s§@¤F¤@­Ó¦W¬°Sales
Sales=INDEX(«È¤á¸ê®ÆºÞ²z!$A$2:$D$1000, MATCH(±M®×¬ö¿ý!$C$2:$C$1000, «È¤á¸ê®ÆºÞ²z!$A$2:$A$1000,0),4)

µM«á§Q¥Î¿ý»s¥¨¶°ªº¤è¦¡°O¿ý¿ý»s,
¤§©Ò¥H¤£Ä@·N, ª½±µ¦bÀx¦s®æª½±µ¤Þ¥Î, ¦p¤U¹Ï:

¬O¦]¬°¾ã­ÓÀÉ®×·|Åܫܤj, ¤]¤£¬üÆ[

¿ý¦nªº¾´®×ªø³o¼Ë
Sub ¥¨¶°1()
'
' ¥¨¶°1 ¥¨¶°
'
    Range("D2").Select
    ActiveCell.FormulaR1C1 = "=Sales"
    Range("D3").Select
End Sub

µM«á§Ú§â¥¦§ï¨ì§Úªº¼Ò²Õ¸Ì
Sub ±M®×¬ö¿ý() 'Pro_Statu

Dim NewPro As Range
Dim PN As Range
Dim Cus As Range
Dim Sales_P As Range
Dim EnCus As Range

Sales_P.FormulaR1C1 = "=Sales"

   With Worksheets("±M®×¬ö¿ý")
    Set PN = .Columns(2).Cells.Find(Pro_Statu.Text_PN.Value, LookIn:=xlValues, Lookat:=xlWhole)
    Set Cus = .Columns(3).Cells.Find(Pro_Statu.Combo_Cus.Value, LookIn:=xlValues, Lookat:=xlWhole)
    Set EnCus = .Columns(12).Cells.Find(Pro_Statu.Text_EnCus.Value, LookIn:=xlValues, Lookat:=xlWhole)
   
   
    If Not PN Is Nothing And Not Cus Is Nothing And Not EnCus Is Nothing Then
   
     MsgBox "¸Ó«È¤á¤w¶}¥ß¦¹®×!  ¦p±ý­×§ï¡A½Ð¿ï¾Ü¬ö¿ýºûÅ@¡AÁÂÁ¡D", vbOKOnly + vbExclamation
            Pro_Statu.Combo_Cus.SetFocus
            Exit Sub
     Else
     
      Set NewPro = .Range("a65536").End(xlUp).Offset(0, 0)
        NewPro.Offset(1, 0) = "Going"
        NewPro.Offset(1, 1) = Pro_Statu.Text_PN
        NewPro.Offset(1, 2) = Pro_Statu.Combo_Cus
       NewPro.Offset(1, 3) = Sales_P
'        NewPro.Offset(1, 4) = Qprice
'        NewPro.Offset(1, 5) = Sprice
        NewPro.Offset(1, 6) = Date
        NewPro.Offset(1, 7) = Date
        NewPro.Offset(1, 8) = Pro_Statu.Text_Model
        NewPro.Offset(1, 9) = Pro_Statu.Combo_App
        NewPro.Offset(1, 10) = Pro_Statu.Text_Qty
        NewPro.Offset(1, 11) = Pro_Statu.Text_EnCus
        NewPro.Offset(1, 12) = Pro_Statu.Combo_Cntry
        NewPro.Offset(1, 13) = Pro_Statu.Text_Cap
        NewPro.Offset(1, 14) = Pro_Statu.Text_Rev
        NewPro.Offset(1, 15) = Pro_Statu.Text_Com
     
    End If

    End With

¤£¹L·|¤@ª½¶]¥X¿ù»~°T®§:


¦A³Â·Ð¤j¤j, 3Q

TOP

¦^´_ 12# Hsieh

¤F¸Ñ
¤£¹L¦pªG¬O¨ä¥L¥Îªk©O
¦p:
Sales=INDEX(«È¤á¸ê®ÆºÞ²z!$A$2:$D$1000, MATCH(±M®×¬ö¿ý!$C$2:$C$1000, «È¤á¸ê®ÆºÞ²z!$A$2:$A$1000,0),4)
§Ú³]©w¤F·í§Ú¿ï¾Ü¤F«È¤á³o­Ó¿ï¶µ, ®ÇÃ䪺·~°ÈÄæ¦ì·|¦Û°Ê§ä´M«e¤@¤@­Óªí®æªº¤º®e, ¨Ã±N¨ä¬Û¹ïÀ³ªº¸ê®Æ¶ñ¤J¦¹ªí®æ¤¤, ¸Ô²Ó¦p¤W¤@­Ó¦^ÂÐ

¥u¬O§Ú¤£ºÞ¦p¦ó¤Þ¥Î
¦p±NSales.Value
³£¬O¤£¦æªº

¤£¹L­è­è¤j¤j¦³´£¨ìrowsourceªºÄÝ©Ê ¥u¯à¦b¸ÓÄݩʤºÅÜ°Ê
©Ò¥H§Ú¤~¦³¦¹¤@°Ý
¦pªG§Ú¦b°ÊºAªí®æ¤º³]©w¤F¨ä¥Lªº¤½¦¡
¨Ì·Ó¤j¤jªºÁ¿ªkÀ³¸Ó¬O¥i¥H³Q¤Þ¥Î¦bVBA¸Ì
¦ý¬O¨C¦¸ªº¿ù»~´N¬O: ¥¼©w¸qÅܼƦWºÙ¤§Ãþªº
Åý§Ú¦³ÂI§xÂZ^^"

¯u¬O¤£¦n·N«ä, ¤£¹L§A­è­è»¡ªº¤èªk
¬O¨S°ÝÃDªº^^ §Ú¤]°O¤U¨Ó°Õ!!
¦A³Â·Ð¤F, ÁÂÁÂ

TOP

¦^´_ 14# Hsieh


«¢«¢  ©êºp ©êºp§Ú¤@ª½¨S»¡²M·¡
³o¤£¬O¤U©Ô¦¡¿ï³æ, ¥u¬O¦]¬°¬Ý¨ìª©¤j¥Î¤F³o©Û
¬ðµMµo²{, ¨º­Ó¥\¯à¤]¥i¥H©w¸q§OªºªF¦è
©Ò¥H´N¬ðµo©_·Q, ¨º¦pªG§Ú§â­ì¥ý­n©w¸qªº¤½¦¡¤]¥Î¤@­Ó¦WºÙ¥ý©w¸q
©Ò¥H¤~·|¦³­è­è¨º­Ó¤½¦¡
¦Ó¸Ó¤½¦¡¥D­nªº¥Øªº¬O
¬°¸`¬Ù¿é¤J©Òªá¶Oªº®É¶¡
¦b«e¤@±iªí®æ¤º§Ú¦³«Ø¥ß¤F«È¤áªº°ò¥»¸ê®Æ»P©Ò­t³dªº·~°È
©Ò¥H§Ú·|§Æ±æ¤§«á¦pªG¦³¿ï¾Ü¤F«È¤á,  ¦b¿é¤J·s¶}±M®×ªº¸ê®Æ¦P®É, ´N·|¦Û°Ê§â­t³dªº·~°È¤@¦P±a¤J

¦pªG¥u¬O³æ¯Â©w¸q, µM«áª½±µ®M¦¨¤½¦¡¨Ï¥Î´ú¸Õ«á¬OOKªº
¤£¹L°ÝÃD¬O­n¼g¶iVBA¸Ì­±, ´N¤£¦æ­ù,  §ÚÁÙ¯S§O¥Î¤FFormulaR1C1
ÁÙ¬O¤£¦æ(¤£¹L¥Î¿ý»s¥¨¶°ªº¤è¦¡¬Ý¸ÓÀÉ®×, ¸Ì­±½T¹ê¤]¬O¥ÎformulaR1C1)
©Ò¥H¤£À´¬°Ô£§ï¼g«á, ´N¤£¦æ

¯u¬O¤£¦n·N«ä, §Ú¦AÄ~Äò¬ã¨s¤@¤U

TOP

¦^´_ 16# Hsieh


§A¬O¯«XD
­ì¨Ó¦p¦¹
¹ï!! ¥L´N¬O¤@ª½nothing
3Q 坂¤j
³o¼Ë§Ú©ú¥Õ­ù

TOP

        ÀR«ä¦Û¦b : ¦h°µ¦h±o¡C¤Ö°µ¦h¥¢¡C
ªð¦^¦Cªí ¤W¤@¥DÃD