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

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

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



½Ð±Ð¤j¤j­Ì,
¦p¦ó¼g¤@­Óvba ©Î¬Omacro ¿é¤JÀx¦s®æªºÃC¦â(¯»¦â),±Nsheet¤¤¬Û¦PÃC¦â(¯»¦â\Äæ¦ì),µM«á½Æ»s¨ì¥t¤@­Ósheet ¤¤.
     ½Ð¤j¤j­Ì«ü¾É.

ÁÂÁ¤j¤jÀ°¦£.

§Ú°õ¦æ«á¦³¥X²{¤U¦C°T®§,§Ú­n¦A­×§ï¦ó³B?

TOP

§Ú¸ÕµÛ¥ÎMACRO¿ý»s¦³¦¨¥\¨úªºÀx¦s®æ(¬õ¦â)ªº­È.
³æ¤@¦æ¥i¥H¦¨¥\,¨º¦h¦æªº¸Ü­n«ç»ò­×§ï¨úªº¦h¦æªº­È.
½Ð¤j¤j¦A¦¸«ü¾É

  1. Sub Macro7()
  2. '
  3.      With Application.FindFormat.Interior
  4.         .PatternColorIndex = xlAutomatic
  5.         .Color = 255
  6.         .TintAndShade = 0
  7.         .PatternTintAndShade = 0
  8.     End With
  9.     Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
  10.         xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
  11.         , SearchFormat:=True).Activate
  12.     Sheets("Sheet1").Select
  13.     Range("A8:AJ8").Select
  14.     Selection.Copy
  15.     Sheets("Sheet2").Select
  16.     ActiveSheet.Paste
  17. End Sub
½Æ»s¥N½X

TOP

¥X²{¬Û¦Pªº¿ù»~,  §Ú¨Ï¥Îªº¬Oexcel 2007 ¤£ª¾¹D¦³¨S¦³Ãö³s?

TOP

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2014/8/15 14:02): ½Ð¤W¶Ç³oµ{¦¡½XªºÀÉ®×

¤j¤j½Ð¦A¹L¥Ø.
ÁÂÁÂ

2014-08-15_114137.jpg

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 : °µ¸Ó°µªº¨Æ¬O´¼¼z¡A°µ¤£¸Ó°µªº¨Æ¬O·Mè¡C
ªð¦^¦Cªí ¤W¤@¥DÃD