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

½Ð°Ývba­n«ç¼Ë¼g¤~¯àÅý¤å¦rÃC¦â¥æ¤e§e²{@@

½Ð°Ývba­n«ç¼Ë¼g¤~¯àÅý¤å¦rÃC¦â¥æ¤e§e²{@@

¦pÃD¡A­n«ç¼Ë¤~¯àÅý¤å¦rÃC¦â¦p¤U¹Ïªº¤è¦¡§e²{
¨Ò¦p¤@¶}©l¥ÎÂŦâ¡A¹J¨ì¤U¤@­Ó¤£¤@¼Ëªº¦WºÙ®É¡A´«¥t¥~¤@­ÓÃC¦â¼Ð¥Ü
¥Î¨âºØÃC¦â¨Ó¼Ð¥Ü¡A¨C­Ó¦WºÙªº¸ê®Æ¶q¤£¤@©w

³o¬O§Ú¥Ø«e·Q¨ìªº¤èªk¡A¦p¦³°ª¤â¦³§ó¦nªº¤è¦¡Åwªï«ü±Ð~~~
  1. Sub color()
  2.     color1 = -3902908
  3.     color2 = -13270700
  4.     With ActiveSheet
  5.         r = .Columns(1).Find(what:="*", LookIn:=xlValues, SearchDirection:=xlPrevious).Row
  6.         c = color1
  7.         CC = 1
  8.         .Cells(1, "A").Font.color = c
  9.         For i = 1 To r
  10.             a = .Cells(i, "A")
  11.             If i = 1 Then
  12.                 b = .Cells(i + 1, "A")
  13.             Else
  14.                 b = .Cells(i - 1, "A")
  15.             End If
  16.             If a = b Then
  17.                 .Cells(i, "A").Font.color = c
  18.             ElseIf a <> b And CC = 1 Then
  19.                 c = color2
  20.                 CC = 0
  21.                 .Cells(i, "A").Font.color = c
  22.             ElseIf a <> b And CC = 0 Then
  23.                 c = color1
  24.                 CC = 1
  25.                 .Cells(i, "A").Font.color = c
  26.             End If
  27.         Next i
  28.     End With
  29. End Sub
½Æ»s¥N½X

TOP

Sub TEST()
Dim xR As Range, xH As Range, T$, Cr, c%
[A:A].Font.ColorIndex = 1
Cr = Array(5, 3)
For Each xR In Range([A1], [A65536].End(xlUp))
    If xR & "" <> T Then Set xH = xR: T = xR & ""
    If xR(2) & "" <> T Then
       Range(xH, xR).Font.ColorIndex = Cr(c)
       c = (c + 1) Mod 2
    End If
Next
End Sub

TOP

google"EXCEL°g"  blog  ©Îgoogleºô§}:https://hcm19522.blogspot.com/

TOP

Sub TEST()
Dim xR As Range, xH As Range, T$, Cr, c%
[A:A].Font.ColorIndex = 1
Cr = Array(5, 3)
F ...
­ã´£³¡ªL µoªí©ó 2020-12-21 19:59


ª©¤jªº«Å§i
T$ c%
¦ý¦bµ{¦¡¤º¥u¦³ T c
½Ð°Ý³oªþ±aªº²Å¸¹ $ %¦b«Å§i¤º¦³¤°»ò§@¥Î¶Ü¡H
²öÅý¥L¤H¿ù»~¶Ë®`¦Û¤v

TOP

¦^´_ 5# y54161212

¥i¦Û¦æ¥h¬d"Åܼƫ¬ºA" ªº¬ÛÃö»¡©ú...EXCEL¤¤ªº»¡©úÀÉ ©Î GOOGLE

TOP

¦^´_  y54161212

¥i¦Û¦æ¥h¬d"Åܼƫ¬ºA" ªº¬ÛÃö»¡©ú...EXCEL¤¤ªº»¡©úÀÉ ©Î GOOGLE
­ã´£³¡ªL µoªí©ó 2020-12-23 14:34


²×©ó§ä¨ì¤F!
Ãþ«¬ªºÂ²²¤ªí¥Üªk¬°¡G% -integer; & -long; @ -currency; # -double; ! -single; $ -string
²öÅý¥L¤H¿ù»~¶Ë®`¦Û¤v

TOP

¦^´_ 1# s13030029

§Ú¨Ó´£¨Ñ¤@­Ó "¦³½ì" ªº¼gªk

Sub Test1224()
    Dim Cor: Cor = Array(10, 5)
    Range([A1], [A1].End(4)).Select
    On Error Resume Next
    Do Until Err <> 0
      K% = K% + 1: Selection.Font.ColorIndex = Cor(K Mod 2)
      Selection.ColumnDifferences(ActiveCell).Select
    Loop: [A1].Activate
End Sub
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 1# s13030029
½Ð°Ñ¦Ò
Sub test()
    Dim mycolor%, x$, cell As Range
    For Each cell In Range([A1], [A65536].End(3))
        If cell.Value <> x Then
            mycolor = IIf(mycolor = 5, 10, 5)
            x = cell.Value
        End If
        cell.Font.ColorIndex = mycolor
    Next cell
End Sub

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡µLªk¾B¾×¡j©È®É¶¡®ø³u¡Aªá¤F³\¦h¤ß¦å¡A·QºÉ¦U¦¡¤èªk­n¾B¾×®É¶¡¡Aµ²ªG¬O¡G®ö¶O¤F§ó¦h®É¶¡¡A¥B¤@µL©Ò¦¨¡I
ªð¦^¦Cªí ¤W¤@¥DÃD