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

[µo°Ý] ¨âªí¤ñ¹ï«á±Nµ²ªG¿é¥X

¦^´_ 20# lpk187
lpk¤j
³o¬q»¡ªk¤Ó°ª²`...
¥i§_·Ð½ÐÁ|­Ó¹ê¨Ò­É³ë?
ÁÂÁ¡I

TOP

¥»©«³Ì«á¥Ñ lpk187 ©ó 2022-6-2 10:50 ½s¿è

¦^´_ 21# shuo1125


    °ª²`¡H¤£·|§a¡I
¦P¤@­Óµ{§Ç®É
Brr()¥Î¥Îªk¬O°µ«Å§i¡ADim Brr() ©Î Brr(2,2)...¥¦¨ä¹ê´N¬O§i¶D¹q¸£¡A§Úªº¨®¤ñ¸û¤j¡A¥i¥H¸Ë¤ñ¤@¯ëªºÅܼƪº¼Æ¶qÁÙ¦h¡A¦]¬°¥¦¬O°}¦C
¦ÓBrr¬O¥¦¶}©l¸ü³f¤~¥Î¡A¨Ò¦p Brr=Range("A1:B5")¡A©Ò¥HBrr©MBrr()¥»¨Ó´N¬O¦P¤@­Ó¡A¬JµM¬O¦P¤@­Ó­þ¬Obrr=brr()¡A¤£¯à³o¼Ë»¡ªº¡A
§A·|¸ò§O¤H»¡ §A=§A¶Ü¡HÁÙ¦³ ¦bµ{¦¡»y¨¥¸Ì­±¡A"=" ¤£¬O¼Æ¾Ç¤¤ªº µ¥©ó¡A¦Ó¬O§â³f¸Ë¨ì³oªº·N«ä¡I

TOP

¥»©«³Ì«á¥Ñ singo1232001 ©ó 2022-6-2 16:00 ½s¿è

¦^´_ 21# shuo1125

¥ÎÅ]Ã~¥@¬É¹CÀ¸ ¥]¥] ªº·§©À ¥]¥]¤º¥i©ñ¥ô¦óªF¦è     ¥]¬A·sªº¥]¥]
   dim  br ¬O 1®æ¥]¥]
   redim  br(3,3 ) ¬O16®æ¥]¥] ¬O4x4(¹³¯u¹ê¹CÀ¸Åã¥Ü¨º¼Ë)
   dim  br(15) ¤]¬O 16®æ¥]¥]  ¥]¥]¬O¤@±ø±q¤W¨ì¤U1234567....16®æ
   
   ' dim  br(3) : dim ar(3) : for i = 0 to 3 : br(i)=ar  : next     
    br(3)(3) ¤]¬O4®æ¥]¥]¤º©ñ¤J4®æ¥]¥]  ¤]¬O4x4  16®æ


¥ÎÀÉ®×Á`ºÞ¸ê®Æ§¨·í·§©À ¸ê®Æ§¨¤º¥i¥H©ñ¥ô¦óªF¦è  ¥]¬A·s¸ê®Æ§¨
  dim br ¬O¤@­Ó¸ê®Æ§¨ ¥u¯à©ñ¤@¼Ë
  redim br(3,3) ¥i¥H©ñ16¼Ë 4x4(Ãþ¦ü ¤j¹Ï¥ÜªºÂsÄý¤è¦¡)  
  dim br(15)  ¸ê®Æ§¨¤º¥i¥HÅý§A©ñ16­Ó (Ãþ¦ü ±q¤W¨ì¤U ¸Ô²Ó²M³æ¼Ò¦¡)

  ¤@¼Ë¥i¥Hbr(3)(3)

TOP

¦^´_ 22# lpk187
lpk¤j
¤j·§¤F¸Ñ¤F¡A¦]«D¬ÛÃö¬ì¨t©Ò¥H¹ïµ{¦¡»y¨¥«Ü­¯¥Í...
¬G¦b¸ÑŪ¤W¥i¯à»~¸Ñ¡AÁÂÁ±zÁÙ¯S·NÃöª`¦^´_¡C

TOP

¦^´_ 23# singo1232001
¼y¤j
§AÁ|ªº¨Ò¤l°}¦C»¡©ú±o«Ü¸ÔºÉ...
³s§Ú³o¤@¬¤£³qªº³£¯à¤j­P¤W²z¸Ñ¡A
ÁÂÁ±z©âªÅ¦^´_¡I

TOP

²Ê²Lªº»¡
Dim Arr, Brr(), Crr(9,9)

(1)
Arr ¬OVariant, ¥i¥H½á¤_³æ¤@¤¸¯À, ©ÎÀx¦s®æ½d³ò¦¨¤@°}¦C, ©ÎRedim¬°¤@­Ó°}¦C
¨Ò:Arr=9, Arr="abc", Arr=range("A1:E9"), Redim Arr(1 to 9, 1 to 3)
   ¤£ºÞArr¤w³Q½á¤_¦óºØ«¬ºA¤Î¤º®e, ¨ä«á¤´¥iª½±µ¹ï¨ä½á¤_¨ä¥¦«¬ºA¤Î¤º®e,
   ·í¥Î Arr = Crr, ¤]¬O¥i¥H±µ¦¬¨ä¥¦"¤v©w¸q¥B¦s¦b"ªº°}¦C,
  
   ¦pªG³Q©w¬°°}¦C, ³Ì«á­nÄÀ©ñ¨ä¦û¥Îªº°O¾ÐÅé®É, ­Y¥Î Erase Arr, «h¥¦ÁÙ¬O°}¦C«¬ºA, ¥u¬O¨S¦³¤j¤p,
   ·íµM, ¥¦ÁÙ¬O¥i¥H¦A½á¤_¥ô¦ó¤º®e, ¦p Arr = Empty (ªì©l¤Æ)
__¥¦¬O¯È¼ß, ¥i¥H»s¦¨¥ô¦ó©Ò»Ý, ¦^¦¬®ÉÅܦ¨¯È¼ß

(2)
Brr(), ¬°°}¦C, ¥u¬OÁÙ¨S©w¤j¤p, ¦Ó¥B¥u¯à¥Î¤_°}¦C, ´N¹³¤@¶ô¦a¤w³W¹º»\©Ð¤l, ÁÙ¨S©w¥X»\´X¼h¤Î¹j¶¡, °£¤F©Ð¤l¤£¥i®¿§@¥¦¥Î,
¨ä¶¡¥i¥H¦b¥ô¦ó®É­Ô­«·s©w¸q¨ä¤j¤p¤Îºû«×, ¦p Redim Brr(9),  ¨C¦¸­«©w¸q, «e¨­¸ê®Æ§Y®ø¥¢,
­Y­n«O¯d«e¸ê®Æ, ¥BÂX®iªÅ¶¡, ¥i¥Î ReDim Preserve , ¦ý¥u¥i¥H§ïÅ̫ܳá¤@­Óºû«×ªº¤W¼Ð¬É¡A¦Ó¤£¯à§ïÅܺû¼Æ¡C
¥i¥Î Erase Brr ÄÀ©ñ¸ê®Æ, ¦ý«áÄò­n¥Î, ±o­«·s©w¸q!!
__¥¦¬O¤@±i¯È, µLªk¸ËªF¦è, ¥i¥H§é¦¨¥ô¦ó«¬ª¬¤Î¤j¤p¥h¸ËªF¦è, «ì´_®ÉÁÙ¬O¤@±i¯È!!!

(3)
Crr(9, 9) ,¬°©T©w¤j¤pªº°}¦C, ³oÀ³¤£»Ý»¡©ú, Erase Crr ÄÀ©ñ¸ê®Æ, ¦ý¥u¬O²MªÅ¤º®e, ¤j¤pÁÙ¬O¤@¼Ë
__¥¦¬O­Ó¯È½c, ¥i¸Ë©T©w¤j¤pªºªF¦è, ­Ë±¼¥þ³¡¦AÄ~Äò¥Î

TOP

¥»©«³Ì«á¥Ñ singo1232001 ©ó 2022-6-3 18:41 ½s¿è

¦^´_ 25# shuo1125





°}¦C¶K¦^¤u§@ªí
¨Ó·½ ¥x¤jptt
https://www.ptt.cc/bbs/Visual_Basic/M.1485488105.A.DB6.html

±Ð¾Ç °}¦C·§©Àµøı¤Æv3.zip (10.35 KB)

TOP

¦^´_ 26# ­ã´£³¡ªL
­ã¤j
³s­ã¤j³£¥X²{¤F...§Aµ¹¤©§Ú«Ü¤jªº±Òµo¡A
¦ý§Aªº«ä¸ô¤ÎÅÞ¿è¹ê¦b¤ÓÅܤƲö´ú¡A
¹ï§Ú³o·s¤â¨Ó»¡Ãø«×¯uªº¤Ó°ª...
ÁÂÁ±z¤£§[ªº¸Ñ»¡¡C

TOP

¦^´_ 28# shuo1125
¼y¤j
¤Ó·PÁ¤F..ÁÙ±N³sµ²§iª¾¡A
³o½×¾Â¤£¦ý»E¶°«Ü¦h°ª¤â¡AÁÙ¯à²@¤£«O¯dªº«ü¾É¡A
¯u¤ß·P¿E¡C

TOP

'If UCase(xD(T)(1)) = "DR" Then
'    If Arr(i, 10) > Arr(i, 11) Then
'        Brr(M, 7) = Brr(M, 7) + Arr(i, 10)
'    Else
'        Brr(M, 7) = Brr(M, 7) + Arr(i, 11)
'    End If
' ElseIf UCase(xD(T)(1)) = "CR" Then
'    If Arr(i, 10) > Arr(i, 11) Then
'        Brr(M, 7) = Brr(M, 7) - Arr(i, 10)
'    Else
'        Brr(M, 7) = Brr(M, 7) - Arr(i, 11)
'    End If
' End If


>>>>>
If UCase(xD(T)(1)) = "DR" Then S = 1 Else S = -1
If Arr(i, 10) > Arr(i, 11) Then C = 10 Else C = 11
Brr(M, 7) = Brr(M, 7) + Arr(i, C) * S

TOP

        ÀR«ä¦Û¦b : ¦³Ä@©ñ¦b¤ß¸Ì¡A¨S¦³¨­Åé¤O¦æ¡A¥¿¦p¯Ñ¥Ð¤£¼½ºØ¡A¬Ò¬OªÅ¹L¦]½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD