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

[µo°Ý] ³sÄò3¶g¥H¤W¸ê®Æ¼Ð¥Ü

[µo°Ý] ³sÄò3¶g¥H¤W¸ê®Æ¼Ð¥Ü

³sÄò3¶g.jpg
½Ð±Ð¦U¦ì¥ý¶i:
¥Ñ¥kÃä³Ì«á¤@¶gºâ°_,³sÄò3¶g¥H¤Wªº¦æ¦C,¥H¶À¦â©³¦â¼Ð¥Ü,¦p¦ó¥HVB§¹¦¨

¦^´_ 2# stillfish00
  1. For j = cmax To 2 Step -1
  2.                 If ar(i, j) = "" Then Exit For '¨S¦³¸ê®Æ¸õ¥X°j°é
  3.             Next
½Æ»s¥N½X
§Aªºµ{¦¡½X¥u¥i¼Ð¥Ü¥X¥Ñ³Ì«á©¹«eºâ³sÄò3¶g¥H¤W¸ê®Æ
¦p¸ê®Æ¦³¤¤Â_«á,¦A©¹«eÁÙ¦³³sÄò3¶g¥H¤W¸ê®Æ,§Aªºµ{¦¡½XµLªk¼Ð¥XÀx¦s®æ©³¦â

­×¥¿¤@¤U,¥i¼Ð¥X¸ê®Æ¤¤¤£¥u¤@­Ó°Ï¶¡¦³³sÄò3¶g¥H¤W¸ê®ÆÀx¦s®æ©³¦â
  1. Option Explicit
  2. Sub Ex()
  3.     Dim R As Long, C As Long, Cmax As Integer
  4.     With ActiveSheet.Range("A1").CurrentRegion
  5.         .Cells.Interior.ColorIndex = xlNone
  6.         For R = 2 To .Rows.Count
  7.             C = 2
  8.             Do While C <= .Columns.Count
  9.                 Cmax = 0
  10.                 Do While .Cells(R, C + Cmax) <> ""
  11.                     Cmax = Cmax + 1
  12.                 Loop
  13.                 If Cmax >= 3 Then .Cells(R, C).Resize(, Cmax).Interior.Color = vbYellow
  14.                 C = C + 1 + Cmax
  15.             Loop
  16.         Next
  17.     End With
  18. End Sub
½Æ»s¥N½X
1

µû¤À¤H¼Æ

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

TOP

¦^´_ 2# stillfish00

´ú¸ÕµL°ÝÃD,ÁÂÁ¤j¤j«ü±Ð

TOP

¦^´_ 1# jcchiang
  1. Sub Test()
  2.     Dim ar, i As Long, j As Long, cmax As Long
  3.    
  4.     With ActiveSheet
  5.         ar = .[A1].Resize(.Cells(.Rows.Count, 1).End(xlUp).Row, .Cells(1, .Columns.Count).End(xlToLeft).Column).value
  6.         cmax = UBound(ar, 2)
  7.         For i = 2 To UBound(ar)
  8.             For j = cmax To 2 Step -1
  9.                 If ar(i, j) = "" Then Exit For
  10.             Next
  11.             If cmax - j >= 3 Then .Range(.Cells(i, j + 1), .Cells(i, cmax)).Interior.Color = vbYellow
  12.         Next
  13.     End With
  14. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

        ÀR«ä¦Û¦b : ¦³´¼¼z¤~¯à¤À¿ëµ½´c¨¸¥¿¡F¦³Á¾µê¤~¯à«Ø¥ß¬üº¡¤H¥Í¡C
ªð¦^¦Cªí ¤W¤@¥DÃD