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

[µo°Ý] [µo°Ý]°}¦C¤º¼Æ­È¶¡®æ°ÝÃD

[µo°Ý] [µo°Ý]°}¦C¤º¼Æ­È¶¡®æ°ÝÃD

¥»©«³Ì«á¥Ñ mark15jill ©ó 2013-1-22 14:57 ½s¿è

»¡©ú
­n¥ÎA.xls Formªí³æ Ū¨ú B.xls Formªí³æ

¸ê®Æ¬°
B.xls ¸ê®Æ ¬° ¤@¦C 10Äæ (±qBÄæ¦ìŪ¨ú¨ì JÄæ¦ì ¡AAÄæ¦ì¤£Åª¨ú¦ý¦³§PÂ_)
ªí³æ¤¸¥ó 3*3 Textbox
cmbox(2).Text ¬° Combobox°}¦Cªº²Ä¤G­Ó §@¬°§Ç¸¹¹ïÀ³¥Î


ºÃ°ÝÂI
1.­n«ç§â­ì©l½X¨º¤T¦æ¿@ÁY¦¨¤@¦æ¡H
¦]¦³¶¡¹j°ÝÃD    ¦p¡G °}¦C X*0 <X¬°0-2> ¬°  B Äæ ~ DÄæ ¡B°}¦C X*1 <X¬°0-2> ¬°  E Äæ ~ GÄæ¡B°}¦C X*2 <X¬°0-2> ¬°  H Äæ ~ JÄæ

2.­Y±N °}¦C3*3 µø¬°³sÄò¤¸¥ó(¦p txt1(0~8)   )¨Ã·f°t­ì©l½X  ­n¦p¦ó·f°t¡H


­ì©l½X

        For kkex = 0 To 2
            txt1(kkex, 0).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 2).value
            txt1(kkex, 1).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 5).value
            txt1(kkex, 2).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 8).value
        Next

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

¦^´_ 1# mark15jill
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim kkex, R, C, txt1(0 To 2, 0 To 2)
  4.     kkex = 0: R = 1
  5.     For C = 2 To 10 Step 3
  6.         txt1(kkex, 0) = Cells(R, C).Value
  7.         txt1(kkex, 1) = Cells(R, C + 1).Value
  8.         txt1(kkex, 2) = Cells(R, C + 2).Value
  9.         kkex = kkex + 1
  10.     Next
  11. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ mark15jill ©ó 2013-1-22 15:52 ½s¿è

¦^´_ 2# GBKEE


TO GBKEE¤j¤j
    ÁÂÁ¤j¤jªº±Ð¾É¡C
    ¤j¤j©Ò´£¨Ñªº±Ð¾Ç¤´¬°¦h¦æ
    ³oÂI¤p§Ì¨S»¡²M·¡ ©êºp

     
     ­ì¥»µ{¦¡½X
       For kkex = 0 To 2
            txt1(kkex, 0).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 2).value
            txt1(kkex, 1).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 5).value
            txt1(kkex, 2).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 8).value
        Next

       ·QÅܦ¨
        For kkex = 0 To 2
            txt1(kkex, kkey).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 2).value   '¬õ¦r³¡¥÷¬°ºÃ°ÝÂI     kkey ¬° °}¦C¤¤ªº´`Àô
        Next

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 1# mark15jill


         For kkex = 0 To 2
            txt1(kkex, kkex).Text = oSheet.Cells(cmbox(2).Text + 1, kkex * 3 + 2).Value
        Next
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ mark15jill ©ó 2013-1-22 16:53 ½s¿è

¦^´_ 4# Hsieh


    To Hsieh ¤j¤j
    ÁÂÁ±оÉ
¦ý³o¼Ë·|³y¦¨¿ù¶Ã

txt1(kkex, kkex).Text = oSheet.Cells(cmbox(2).Text + 1, kkex * 3 + 2).Value

If  kkex = 0 then txt1(kkex, kkex).Text = oSheet.Cells(cmbox(2).Text + 1,  2).Value

If  kkex =1 then txt1(kkex, kkex).Text = oSheet.Cells(cmbox(2).Text + 1,  5).Value

If  kkex = 2 then txt1(kkex, kkex).Text = oSheet.Cells(cmbox(2).Text + 1,  8).Value

­Y±Nµ{¦¡±a¤J¼Æ­Èªº¸Ü ·|Åܦ¨ 2 3 4 6 7 9 10 Äæ¦ìŪ¨ú¥¢®Ä

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 5# mark15jill


    ©Ò¥H§A¬O­n3*3ªº¤Gºû°}¦C?
         For kkex = 0 To 2
           For i = 0 To 2
            txt1(kkex, i).Text = oSheet.Cells(cmbox(2).Text + 1, i * 3 + 2).Value
           Next
        Next
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 6# Hsieh


    2ºûªº ¤@ºû°}¦C...@@"

¤p§Ì´«­Ó¤è¦¡»¡¦n¤F...

°}¦C(3*3)
A1    A2    A3
B1    B2     B3
C1    C2     C3

¨Ó·½ÀÉ®×
BÄæ¦ì ¦Ü JÄæ¦ì(2~10)

        '        For kkex = 0 To 2
        '        txt1(kkex, 0).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 2).value  (B~DÄæ¦ì)
        '        txt1(kkex, 1).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 5).value  (E~GÄæ¦ì)
        '        txt1(kkex, 2).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 8).value  (H~JÄæ¦ì)
        '        Next

·Q­n±N ¨º¤T¦æ ¦X¨Ö¦¨¤@¦æ
kkex ¬° °}¦C¤¤ªº X­È
kkey ¬° °}¦C¤¤ªº Y­È
cmbox(2).Text + 1  ¥i·í§@³æ¤@¼Æ­È

        '        txt1(kkex, kkey).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 2).value    '¬õ¦r¶·½Ð¤j¤j±Ð¾É

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 7# mark15jill
¨ì©³¦³´X­ÓTEXTBOX?
¦³¦h¤ÖÀx¦s®æªº­È­n¶ñ¶i¥h³o¨ÇTEXTBOX?
­Y¬O3*3ªºª«¥ó°}¦C¡A¥u¯à¶ë9­Ó­È¡A¦ó¨ÓB~D¡BE~G¡BH~J?

§âÀɮפW¶Ç»¡©ú§a!
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 7# mark15jill

        '        For kkex = 0 To 2
        '        txt1(kkex, 0).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 2).value  (B~DÄæ¦ì)
        '        txt1(kkex, 1).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 5).value  (E~GÄæ¦ì)
        '        txt1(kkex, 2).Text = oSheet.cells(cmbox(2).Text + 1, kkex + 8).value  (H~JÄæ¦ì)
        '        Next
·Q­n±N ¨º¤T¦æ ¦X¨Ö¦¨¤@¦æ

¬°¦ó­n¦X¨Ö , ¦X¨Ö¤£·|¤ñ¸û²M·¡
For i = 0 to 8
     txt1(int(i/3), i mod 3).Text = oSheet.cells(cmbox(2).Text + 1, Int(i / 3) + 3 * (i Mod 3) + 2).value
Next

TOP

¦^´_ 9# stillfish00


    To Hsieh ¤j¤j
   ±q AÄæ~JÄæ ¦@¦³10Äæ¦ì AÄæ¦ì¤£ºâªº¸Ü ¦³9Äæ¦ì
   ¦p±z¹Ï©Ò¥Ü¡A¦ý¶À¦â³¡¤À¬°¦C ¤£¬O¾î¸ó¤T¦C
   ¨Ò B1~J1 ¬°¤@µ§¸ê®Æ
   cmbox(2).text +1 ==> ¦p cmbox(2).text=0
  «h cmbox(2).text +1 ¼Æ­È¬° 1(²Ä¤@¦C)¡C

To stilllfish00 ¤j¤j
   ¦]¬°¸Ó§¹¾ãµ{¦¡½X¹Lªø(¥\¯à³]©w¤Ó¦h)¡A
   ¦Ó¥Bµ{¦¡½X¦ü¥G¦³³W«ß©Ê(¤À¶}¼gªº¸Ü)¡A
   ¤~·Q»¡¯à§_§ä¤èªk¸`¬Ù~"~

   ´ú¸ÕOK ÁÂÁ¨â¦ì¤j¤jªº±Ð¾É

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

        ÀR«ä¦Û¦b : ¤p¨Æ¤£°µ¡B¤j¨ÆÃø¦¨¡C
ªð¦^¦Cªí ¤W¤@¥DÃD