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

­n¦p¦ó±j¨îÅçÃÒTextBoxªÅ¥Õ´N°±¤î

­n¦p¦ó±j¨îÅçÃÒTextBoxªÅ¥Õ´N°±¤î

·Q½Ð°Ý¦U¦ì¤j¤j
¥Ø«e·Q±NTextBox¥ÎÅçÃÒ½X¬O§_ªÅ¥Õ
¦pªGªÅ¥Õ´N°±¤î¿é¤J
±Nµe­±°±®æ¦b¿é¤Jµe­±
Dim A As Range


a1 = User.c1.Value
If a1 = "" Then MsgBox "²Ä¤@Ä椣±oªÅ¥Õ": Exit Sub
If Application.CountBlank([U3:U99]) = 0 Then Range("U100") = a1: Exit Sub
For Each A In [U3:U99]
    If A = "" Then
        A.Value = a1
        Exit For
    End If
Next

¦ý¬O§Úªºµ{¦¡§ï¨Ó§ï¥h
´Nºâ¬OªÅ¥Õ·|¼u¸õ¥Xĵ§iµøµ¡
ÁÙ¬O·|¥ý±N¶ñ¦nªº¸ê®Æ¼g¤J¦bSheet
¦Óµo¥ÍªÅ¥Õ¿ù»~¥H¤UªºÄæ¦ì¤~°±¤î¼g¤J

¤£ª¾¹D¸Ó«ç»ò§ï¤~¯à§¹¬üÅçÃÒ¡Ö"¡Õ
·P¿E¤£ºÉ¡I
Jared

¦^´_ 1# Jared

§Úªþ¤W¤@­Ó´ú¸ÕÀÉ®×
·í§Ú¥u­n²Ä¤GÄæªÅ¥Õ
²Ä¤@ÄæÁÙ¬O·|¼g¤J
­n¦p¦ó¤~¯à³£¶ñ¤WÅçÃÒ§¹¤~¼g¤J©O?

    ´ú¸ÕÀÉX.zip (34.69 KB)
Jared

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2013-3-19 17:32 ½s¿è

¦^´_ 2# Jared
  1. Sub test()
  2. Dim Ar, a1, a2, a3, i%
  3. a1 = TextBox1
  4. a2 = TextBox2
  5. a3 = TextBox3
  6. Ar = Array(a1, a2, a3)  'Äæ¦ìÀx¦s©ó°}¦C
  7. If a1 <> "" And a2 <> "" And a3 <> "" Then  '§PÂ_©Ò¦³­È³£¤£µ¥©óªÅ¥Õ
  8.    i = 1   '²Ä¤@¦C¶}©l
  9.    Do Until Cells(i, 1) = ""  'AÄ欰ªÅ¥Õ«h°±¤î°j°é
  10.        i = i + 1  '¦V¤U¤@¦C
  11.    Loop
  12.    Cells(i, 1).Resize(, 3) = Ar  'AÄæªÅ¥Õ¦V¥kÂX®i¦¨Äæ¦ì¼Æ¶q
  13.    Else  '¨ä¤¤¦³ªÅ¥Õ­È«h°õ¦æ¥H¤Uµ{§Ç
  14.    For i = LBound(Ar) To UBound(Ar)  '°}¦C¯Á¤Þ­È°õ¦æ°j°é
  15.       If Ar(i) = "" Then MsgBox "Äæ¦ì" & i + 1 & "ªÅ¥Õ¥¼¶ñ¼g"
  16.    Next
  17. End If
  18. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 3# Hsieh


    ·PÁ¤j¤j¸Ô¸Ñ
    ¦ýÄæ¦ì¦pªGÅܦh¡A¨Ò¦p¦³5­ÓÄæ¦ì­nÅçÃÒ
    ¬O¤£¬O¦³¤°»ò¦a¤è¨S§ï¨ì©O?
    ´N¨S¿ìªk ¶¶§QÅçÃÒ©M³sÄò©¹¤U¶ñ¼g¸ê®Æ¤F >"<

    Sub test()
Dim Ar, a1, a2, a3, a4,a5,i %
a1 = TextBox1
a2 = TextBox2
a3 = TextBox3
a4 = TextBox4
a5 = TextBox5
Ar = Array(a1, a2, a3,a4,a5)
If a1 <> "" And a2 <> "" And a3 <> "" And a4 <> "" And a5 <> "" Then
   i = 1
   Do Until Cells(i, 1) = ""
       i = i + 1
   Loop
   Cells(i, 1).Resize(, 5) = Ar
   Else
   For i = 0 To 2
      If Ar(i) = "" Then MsgBox "Äæ¦ì" & i + 1 & "ªÅ¥Õ¥¼¶ñ¼g"
   Next
End If
End Sub
Jared

TOP

¦^´_ 3# Hsieh


    ·Q½Ð°Ý¤@¤U¤j¤j
    ·í§Ú·Q­n±N¼g¤J¦ì¸m§ó§ï¬°B1 Äæ¦ì¶}©l
    ¬°¤°»ò´NµLªk·s¼W²Ä¤Gµ§©O?
    ±N³o¦æµ{¦¡ Cells(i, 1).Resize(, 3) = Ar
    §ó§ï¬°          Cells(i, 2).Resize(, 3) = Ar
    µ{¦¡´N°Ê¤£¤F¤F >"<
Jared

TOP

§Ú¤w¸g§ä¨ì¤èªk¤F(^¤f^)
±Nµ{¦¡§ó§ï¬°

With Sheet10
   .Cells(.Rows.Count, 2).End(xlUp).Offset(1).Resize(, 5).Value = Ar
   End With

´N¥i¥H©¹B2Äæ¼g¤J¸ê®Æ¤F
Jared

TOP

        ÀR«ä¦Û¦b : §ïÅܦۤv¬O¦Û±Ï¡A¼vÅT§O¤H¬O±Ï¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD