ªð¦^¦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­Ì«ü¾É.

§Ú¯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

·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

¦^´_ 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

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2014-8-16 16:49 ½s¿è

¦^´_ 7# GBKEE
  1.     Set Sh = ActiveSheet
  2.     ' Set A = Sh.Cells.Find("", AFTER:=Sh.Cells(Sh.Cells.Count), SearchFormat:=True) 'SearchFormat   ¿ï¾Ü©Êªº Variant¡C·j´Mªº®æ¦¡¡C
  3.     Set A = Sh.Cells.Find("", AFTER:=Sh.Cells(1), SearchFormat:=True) 'SearchFormat   ¿ï¾Ü©Êªº Variant¡C·j´Mªº®æ¦¡¡C
½Æ»s¥N½X
Sh.Cells(Sh.Cells.Count)=<·¸¦ì>
§ï¦¨Sh.Cells(1) «K OK ¤F¡C

TOP

¦^´_ 8# sunland

§A¥i¥HÂI¤@¤U "°»¿ù" «ö¶s,
¥¦·|§i¶D§Aµo¥Í·¸¦ìªº¬O­þ­ÓÅܼÆ.
¦A±N¸ÓÅܼƪº¸ê®Æ«¬ºA½Õ¤j, (Åܧó Dim ªºÅܼƫŧi«¬ºA)
§Ú²q´ú¬O§A¨Ï¥Î¨Óªí¥Ü¦C¸¹ªºÅܼƫ¬ºA³]¤Ó¤p¤F (¦p : Integer)
¥Î©ó¦C¸¹ªºÅܼƫØij³]¬° Long ªº«¬ºA.

TOP

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

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

2014-08-15_114137.jpg

TOP

¦^´_ 6# sunland
¥X²{¬Û¦Pªº¿ù»~
¥i§_¤W¶Ç¦p³oÅã¥Ü¿ù»~ªºµe­±
©Î¬O¿ù»~½X


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

TOP

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

TOP

¦^´_ 4# sunland

¦A¸Õ¸Õ¬Ý
  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.     Do While Not A Is Nothing
  17.         If A_Po = "" Then
  18.             A_Po = A.Address
  19.             Set AA = A
  20.         End If
  21.         Set AA = Union(AA, A)
  22.         Set A = Sh.Cells.Find(What:="", AFTER:=A, SearchFormat:=True) '¤U¤@­Ó¬Û¦P®æ¦¡·j´M
  23.         If A_Po = A.Address Then Exit Do
  24.     Loop
  25.     If Not A Is Nothing Then AA.Copy Sheets("¥Ø¼Ð¤u§@ªí").Range("A1")
  26. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : «Î¼e¤£¦p¤ß¼e¡C
ªð¦^¦Cªí ¤W¤@¥DÃD