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

[µo°Ý] °}¦C¤j¤p¦p¦ó¥HÅܼƴÀ¥N

§Ú­×§ïµ{¦¡®É¤@¶}©l´N§âU1ªº­È«ü©wµ¹k¤F-->  k = [U1].Value¡A¦ÓU1ªº­È½T©w¬O¤j©óµ¥©ó1ªº¡C(¹ê»Ú¤u§@®ÉU1ªº¿é¤J­È¥²©w¬O¤j©óµ¥©ó24)
Jess

TOP

' ¦³¥i¯à§Aªº k­È ¥X²{
jackyq µoªí©ó 2019-3-8 21:54

ÁöµM¨S¦³¥X²{°»¿ù¡A¦ý¬O¬d¸ßµ²ªGÅܦ¨³o¼Ë
Jess

TOP

If k >= 1 Then
'        For Each a In .Range(.[A9], .[A6000].End(xlUp))
'            ReDim Br(k)
'
'            For j = 1 To k
'            Br(j) = a.Offset(, j + 159).Value
'            Next j
'            d1(a & "") = Br
'        Next
'    End If

¤£¦n·N«ä¡Aj¤j¡C´ú¸Õ¤wOK¡A¬O§Ú¤Ö­×§ï¤F¤@­Ó¦a¤è¡C¤£¹L§ÚÁÙ¬O¤£¤Ó©ú¥Õ¬°¤°»ò¥[¤F³o¬q
If k >= 1 Then
.
.

End If
´N¨S°ÝÃD¤F
Jess

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2019-3-8 23:19 ½s¿è

(1)
k=0 ®É
·|Åܦ¨ Redim Br(1 To 0)  '--> VBA ¨S¦³¿ìªk°t¸m³oºØ°}¦C
IF K>=1 Then ..... End if ¥i¥H¨¾¤î °õ¦æ¨ì Redim Br(1 To 0)  

(2)
¾¨¶q¤£­n¥h¨Ï¥Î Option Base 1 ³oºØªF¦è

³Ì¦nª½±µ¼g¦¨ Redim Br(1 To K)

TOP

¦^´_ 5# jesscc

§Ú¦b·Q¬O¤£¬OÂà¸ê®Æªº³¡¤À¦³»~

¦Û¦æ°»¿ù¬Ý¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Br() As String, k%, D As Object, A As Range, J As Integer
  4.     On Error GoTo RR   'µ{¦¡¦³¿ù»~®É¨ì«ü©w¦æ¸¹(RR)
  5.     k = [U1].Value
  6.     Set D = CreateObject("Scripting.Dictionary")
  7.     For Each A In Range([A9], [A6000].End(xlUp))
  8.         ReDim Preserve Br(k)
  9.         For J = 1 To k
  10.             Br(J) = A.Offset(, J + 159).Value
  11.         Next J
  12.         D(A & "") = Br(k)
  13.     Next
  14.     Exit Sub
  15. RR:
  16.    Application.VBE.Windows("°Ï°ìÅܼÆ").Visible = True
  17.    
  18.    Stop
  19.    'µ{¦¡¼È°± ¬d¬Ý©Ò¦³ÅܼƬݬݿù»~¦b­þ¸Ì
  20. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ª¾ÃÑ­n¥Î¤ßÅé·|¡A¤~¯àÅܦ¨¦Û¤vªº´¼¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD