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

[µo°Ý] «ç»ò¨ú¦³ÃC¦âÀx¦s®æ¤ºªº­È

¦^´_ 8# sunland
¦^´_ 10# c_c_lai

¨º§ï¬°¦p¦¹¤ñ¸û«ê·í,³Ì«á¤@­ÓÀx¦s®æ§ä°_
  1.     Set Sh = ActiveSheet
  2.     '2003-> Sh.Cells.Count ¬O¨S¿ù»~ªº
  3.      ' Set A = Sh.Cells.Find("", AFTER:=Sh.Cells(Sh.Cells.Count), SearchFormat:=True) 'SearchFormat   ¿ï¾Ü©Êªº Variant¡C·j´Mªº®æ¦¡¡C

  4.     Set a = Sh.Cells.Find("", AFTER:=Sh.Cells(Sh.Cells.Rows.Count, Sh.Cells.Columns.Count), SearchFormat:=True) 'SearchFormat   ¿ï¾Ü©Êªº Variant¡C·j´Mªº®æ¦¡¡C
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

·PÁ¦U¦ì¤j¤jªºÀ°¦£, ¸Õ¤F¦h¦¸²×©ó¦¨¥\.
«Ý¨úªº¬õ¦âÀx¦s®æ

¨úªº¬õ¦âÀx¦s®æ
  1. Option Explicit

  2. Sub Ex()

  3.     Dim A As Range, A_Po As String
  4.     Dim AA As Range, Sh As Worksheet
  5.    
  6.     'FindFormat ÄÝ©Ê ³]©w©Î¶Ç¦^­n´M§ä¤§Àx¦s®æ®æ¦¡Ãþ«¬ªº·j´M·Ç«h¡C

  7.     With Application.FindFormat

  8.         .Clear                      '²M°£¥H«eªº³]©w

  9.         .Interior.Color = vbRed    '³]©wÀx¦s®æ¹Ï¼ËÃC¦â(¬õ¦â)

  10.        ' .Interior.ColorIndex = 3   '³]©wÀx¦s®æ¹Ï¼ËÃC¦â(¬õ¦â)

  11.        '.Font.Bold = True           '²ÊÅé

  12.        '.Font.Size = 12             '¦r«¬¤j¤p

  13.     End With

  14.     'Set Sh = ActiveSheet

  15.     'Set A = Sh.Cells.Find("", AFTER:=Sh.Cells(Sh.Cells.Count), SearchFormat:=True) 'SearchFormat   ¿ï¾Ü©Êªº Variant¡C·j´Mªº®æ¦¡¡C
  16.    
  17.         Set Sh = ActiveSheet

  18.     '2003-> Sh.Cells.Count ¬O¨S¿ù»~ªº
  19.      ' Set A = Sh.Cells.Find("", AFTER:=Sh.Cells(Sh.Cells.Count), SearchFormat:=True) 'SearchFormat   ¿ï¾Ü©Êªº Variant¡C·j´Mªº®æ¦¡¡C


  20.     Set A = Sh.Cells.Find("", AFTER:=Sh.Cells(Sh.Cells.Rows.Count, Sh.Cells.Columns.Count), SearchFormat:=True) 'SearchFormat   ¿ï¾Ü©Êªº Variant¡C·j´Mªº®æ¦¡¡C
  21.    
  22.    
  23.    

  24.     Do While Not A Is Nothing

  25.         If A_Po = "" Then

  26.             A_Po = A.Address

  27.             Set AA = A

  28.         End If

  29.         Set AA = Union(AA, A)

  30.         Set A = Sh.Cells.Find(What:="", AFTER:=A, SearchFormat:=True)  '¤U¤@­Ó¬Û¦P®æ¦¡·j´M

  31.         If A_Po = A.Address Then Exit Do

  32.     Loop

  33.     If Not A Is Nothing Then AA.Copy Sheets("Sheet2").Range("A1")

  34. End Sub
½Æ»s¥N½X
Àx¦s®æªºÃC¦â¥Î .Interior.Color = vbRed    '³]©wÀx¦s®æ¹Ï¼ËÃC¦â(¬õ¦â) ,´N¯à§ä¨ì.
¦ý¥Î' .Interior.ColorIndex = 3   '³]©wÀx¦s®æ¹Ï¼ËÃC¦â(¬õ¦â) ´N¥¢±Ñ(§ä¤£¨ì¬ÛÃöÃC¦â.)
¦pªG¬O¥Î¯à input = ÃC¦â ¥N¤J·íÅÜ¼Æ ¥i¦æ¶Ü? À³¸Ó«ç»ò°µ?
½Ð¦A¦¸«ü¾É.
·PÁÂ

TOP

§Ú¯u¬O¤Ó¤£¥Î¤ß¤F,¤j¤j¦b¤@¶}©l´N«ü¾É«ç»ò§ìcolor code,
§ó·s¤@¤U.

³o¤U¥þ³¡³£¸Ñ¨M¤F~°ÝÃD.
ÁÂÁÂ
  1.   Sub Ex_A()  '§äÃC¦â ColorIndex ¥i¦p¦¹±o¨ì

  2.   MsgBox Range("A1").Interior.ColorIndex  '§ì¦â
  3.   MsgBox Range("A1").Interior.Color    '§ì¦â­È

  4. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¡i¦æµ½­n¤Î®É¡j¦æµ½­n¤Î®É¡A¥\¼w­n«ùÄò¡C¦p¿N¶}¤ô¤@¯ë¡A¥¼¿N¶}¤§«e¤d¸U¤£­n°±º¶¤õ­Ô¡A§_«h­«¨Ó´N¤Ó¶O¨Æ¤F¡C
ªð¦^¦Cªí ¤W¤@¥DÃD