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

[µo°Ý] ¤½¦¡Âà¤Æ¬°µ{¦¡»yªk¡C

¦^´_ 11# papaya
°Ñ¦Ò¬Ý¬Ý,
¤£À´ªºVBAµ{¦¡½X,¥i±N¤£À´ªº¨ç¼Æ,¤èªk,¦bVBA»¡©ú¤W¬d¬Ý¦p Application,©Î Rows
  1. Option Explicit
  2. Private Sub CommandButton1_Click()
  3.     Dim Rng As Range, M As Integer
  4.     Set Rng = Range("DK7", [DK7].End(xlDown))
  5.     M = Application.Max(Rng)
  6.     M = Application.Match(M, Rng, 0)
  7.     [DT1] = Rng.Cells(M).Address(0, 0)
  8.     With Rng.Resize(, 3)
  9.         .Interior.ColorIndex = xlNone
  10.         .Rows(M).Interior.ColorIndex = 8
  11.         [dk4].Resize(, 3) = .Rows(M).Value
  12.     End With
  13. End Sub
  14. Private Sub CommandButton2_Click()
  15.     Dim Rng As Range, M As Integer
  16.     Set Rng = Range("DK7", [DK7].End(xlDown)).Resize(, 3)
  17.     For i = 1 To Rng.Columns.Count
  18.         '*** ·j´M½d³ò¤ºªº¨C­ÓÄæ¦ìªº³Ì¤j­È ****
  19.         With Rng.Columns(i)
  20.             'M = Application.Max(.Cells)
  21.             M = Application.Match(Application.Max(.Cells), .Cells, 0)
  22.             [DT1].Offset(i - 1) = .Cells(M).Address(0, 0)
  23.         End With
  24.         With Rng
  25.             If i = 1 Then .Interior.ColorIndex = xlNone
  26.             .Rows(M).Interior.ColorIndex = Array(, 8, 15, 22)(i)
  27.             [dk4].Offset(i - 1).Resize(, 3) = .Rows(M).Value
  28.         End With
  29.     Next
  30. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2017-11-24 08:44 ½s¿è

¦^´_ 16# papaya

¦h¸Õ¸Õ¬Ý«ü©wª«¥óÅܼÆ,¥i´î¤Övba½s¼gªº¿ù»~
  1. Option Explicit
  2. Private Sub CommandButton1_Click()
  3.     Dim Rng As Range, M As Variant
  4.     Dim Sh As Worksheet
  5.     Set Sh = Sheets("sheet1")
  6.     Set Rng = Sh.Range("DK7:DM" & Sh.[DM65536].End(xlUp).Row)
  7.         With Rng
  8.             .Interior.ColorIndex = -4142
  9.             M = Application.Match(Sh.Range("DK4"), .Columns(1), 0)
  10.             If IsNumeric(M) Then    '¦³§ä¨ì
  11.                 .Cells(M, 1).Resize(1, 3).Interior.ColorIndex = 8
  12.             End If
  13.         End With
  14.     'Range("DK7:DM" & [DM65536].End(xlUp).Row).Interior.ColorIndex = -4142
  15.     'Range("DK" & Application.Match(Range("DK4"), Range("DK7:DK" & Sheets("Sheet1").[DK65536].End(xlUp).Row), 0) + 6).Resize(1, 3).Interior.ColorIndex = 8

  16. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : §g¤l¥ß«í§Ó¡A¤p¤H«í¥ß§Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD