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

[µo°Ý] ¤Tºû°}¦C§ä³Ì¤j­È

[µo°Ý] ¤Tºû°}¦C§ä³Ì¤j­È

¤@­Ó¤Tºû°}¦CPR(1 To 3, 1 To 30)
[ 5, 6, 2, 15, 11, ....]
[10, 21, 17, 5, 25, ...]
[11, 14, 8, 21, 24, ...]
¸Ó«ç»ò§äPR(1, ), PR(2, ), PR(3, )ªº³Ì¤j­È?

Sub UTest()
Dim PR(1 To 3, 1 To 30), MX(1 To 3)
For i = 1 To 3
For j = 1 To 30
    PR(i, j) = Int(Rnd * 1000)
    If PR(i, j) > MX(i) Then MX(i) = PR(i, j)
Next
Next
MsgBox Join(MX, "_")
End Sub

TOP

¦^´_ 1# acdx
©³¤U¬O¤Gºû°}¦C¡G
PR(1 To 3, 1 To 30)

Áö¤£´¿¼g¹L¤Tºû°}¦C¡A¦ý¤TºûÀ³¸Ó¹³¦p¤Uªí¥Ü¦¡¡G
PR(1 To 3, 1 To 30, 1 To 10)

TOP

¥»©«³Ì«á¥Ñ quickfixer ©ó 2018-5-20 21:32 ½s¿è

  1. '¦Û¤v§â²Ä7¦æªº¸ê®Æ¨Ó·½§ï¦¨pr()2ºû°}¦C
  2. Sub test()
  3.     Dim findmax As Object, mx(1 To 3)
  4.     Set findmax = CreateObject("System.Collections.ArrayList")
  5.     For i = 1 To 3
  6.         For j = 1 To 30
  7.             findmax.Add Cells(i, j).Value
  8.         Next j
  9.         findmax.Sort: findmax.Reverse
  10.         mx(i) = findmax.Item(0)
  11.         findmax.Clear
  12.     Next i
  13.     MsgBox Join(mx, "_")
  14.     Set findmax = Nothing
  15. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# quickfixer


³o¼gªk¬O§Ú±q¨S¹Á¸Õ¹Lªº  Åý§Ú¶}²´¬É¤F!
½Ð°Ýfindmax.Sort: findmax.Reverse ¬O¤°»ò·N«ä?
·PÁÂ

TOP

¦^´_ 5# acdx


    ³oÃ䦳¸Ô²ÓªºArrayList¸Ñ»¡»P½d¨Ò(­^¤å)
    http://www.snb-vba.eu/VBA_Arraylist_en.html#L_11.1

TOP

¥»©«³Ì«á¥Ñ quickfixer ©ó 2018-5-24 16:42 ½s¿è

¦^´_ 5# acdx

±q01 S¤j,¨ºÃä¾Ç¨Óªº,¥L±`±`¦³¤@¨Ç«Ü¯S别ªº¼gªk¥X²{
sort¬O±q¤p¨ì¤j±Æ§Ç
Reverse¬O§â±Æ§Ç¦nªº,§ï¦¨±q¤j¨ì¤p±Æ§Ç
³o¼Ëitem(0)´N©T©w¬O³Ì¤j­È
¸ê®Æ¤ÖÁÙ¨S¤°»ò·Pı,¸ê®Æ¦h®É³o­Ó¤è¦¡¶W§Ö
¨ä¹ê¸ê®Æ¤£¦h,¥i¥H¥Îworksheetfunction.max¥N´À,µ{¦¡¤ñ¸ûµu,³t«×¤@¼Ë§Ö

TOP

        ÀR«ä¦Û¦b : ¹D¼w¬O´£ª@¦Û§Úªº©ú¿O¡A¤£¸Ó¬O¨þ¥¸§O¤HªºÃ@¤l¡C
ªð¦^¦Cªí ¤W¤@¥DÃD