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

[µo°Ý] ½Ð¤j®v­ÌÀ°¦£¦Û°ÊÅÜ´«ÃC¦â,ÁÂÁÂ

¦^´_ 10# leirex1201

¬O¥u­nAÄæ©MBÄ榳­È¡AµM«á±q½s¿èªº¨º¤@¦æA¨ìK³£Åܦâ¹ï¶Ü¡H¥u­n§ï¬õ¦rªº³¡¥÷´N¥i¥H¤F
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 3 And Target.Row > 1 And Cells(Target.Row, "B") <> "" And Cells(Target.Row, "A") <> "" Then
    Set col = Sheets("¤½¥q²M³æ").Columns(2).Find(Cells(Target.Row, 2), , , , , 2)
        AA = col.Offset(0, 1).Interior.Color
    Range(Cells(Target.Row, 1), Cells(Target.Row, 11)).Interior.Color = _
    col.Offset(0, 1).Interior.Color
Else
    Range(Cells(Target.Row, 1), Cells(Target.Row, 11)).Interior.Color = 16777215
End If
End Sub

TOP

¦^´_  leirex1201

¬O¥u­nAÄæ©MBÄ榳­È¡AµM«á±q½s¿èªº¨º¤@¦æA¨ìK³£Åܦâ¹ï¶Ü¡H¥u­n§ï¬õ¦rªº³¡¥÷´N¥i¥H¤F
...
lpk187 µoªí©ó 2015-5-11 13:15


·PÁÂlpk187¤j®v

´ú¸Õ¤w¥i¥H¨Ï¥Î,§Ú§â³Ì¤U­±ªºelse if®³±¼¤F,¤£µM½s¿è½d³ò¥H¥~ªºÀx¦s®æ³£·|Åܦ¨"¥Õ©³¦â"
¦A¦¸·PÁÂlpk187¤j®vªº¥Î¤ßÀ°¦£,·P®¦

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 11 And Target.Row > 1 And Cells(Target.Row, "B") <> "" And Cells(Target.Row, "A") <> "" Then
    Set col = Sheets("¤½¥q²M³æ").Columns(2).Find(Cells(Target.Row, 2), , , , , 2)
        AA = col.Offset(0, 1).Interior.Color
    Range(Cells(Target.Row, 1), Cells(Target.Row, 11)).Interior.Color = _
    col.Offset(0, 1).Interior.Color
End If
End Sub
¤Ñ¤ÑªÅªÅ°Ú~

TOP

¦^´_  leirex1201

¬O¥u­nAÄæ©MBÄ榳­È¡AµM«á±q½s¿èªº¨º¤@¦æA¨ìK³£Åܦâ¹ï¶Ü¡H¥u­n§ï¬õ¦rªº³¡¥÷´N¥i¥H¤F
...
lpk187 µoªí©ó 2015-5-11 13:15



¹ï¤F,§Ñ¤F½Ð°Ýlpk187¤j®v
§Ú¥»¨­¹ïÃC¦â¿ëÃѸû®z,
¦pªG¨S¦³¬Û¹ïÀ³ªº¦â½X,¤Ó¬Û¦üªºÃC¦â¤À¤£¤Ó²M·¡
¦³¿ìªk¦Û°Ê¼Ð¥Ü¬Û¹ïÀ³ªº¦â½X¶Ü...¨Ò¦pRGB©ÎCMYK©ÎHTMLªºFFFFFF

ÁÂÁ¤j®v
¤Ñ¤ÑªÅªÅ°Ú~

TOP

¦^´_ 13# leirex1201

¤£¥ÎºÙ§Ú¤j®v¡A§Ú¤]¬Oªì¾ÇªÌ¡I

    »¡¹ê¦bªº¥H¤Wªºµ{¦¡½X¡A§Ú¤]¬O¬Ý¨ì§Aªº°ÝÃD¤§«á¥h°µ¥¨¶°¡AµM«á·Q¥X¨Óªº¡A¦Ó§Ú§ä¨ìªº¤èªk³£¨S¿ìªk¹ïÀ³¨ìRGB
¦ý¥i¥H¥ÎRGB¶ñ¤J¦â±m¡A¬O§_¯à¹ïÀ³¨ìRGB¦â½X¡A´N­n½Ð±Ð¨ä¥L¤j¤j­Ì¤F¡I§Ú§ä¨ìªº¥u¦³¥H¤Uµ{¦¡½X
Sub ¥¨¶°1()
Range("A1:A2").Interior.Color = RGB(0, 255, 1)'A1:A2Àx¦s®æ¶ñ¤J¦â±m
Range("B1") = Range("A1").Interior.Color  '¶Ç¦^A1ª«¥óªº¥D­n¦â±m
Range("B2") = Range("A2").Interior.ColorIndex    '¶Ç¦^A2¥Nªí¤º´º¦â±m
End Sub

TOP

·PÁÂluhpro¤j®v¦^ÂÐ

½Ð°Ý­n¶K¨ìwookbook¶Ü?ÁÂÁÂ
leirex1201 µoªí©ó 2015-5-11 10:00

Private Sub cbGetColor_Click()
§Ú¬O¥Î«ö¶s¨Æ¥ó¨ÓÅX°Ê,
¨C«ö¤@¦¸´N°õ¦æÃC¦âÀˮֻPÅܧó.

TOP

http://blog.xuite.net/hcm19522/twblog/354838322

TOP

Àx¦s®æ¦â±m¥N½X.rar (6.59 KB)
½Ð±Ð¦U¦ì¤j®v

§Ú·Q­n¨Ì"¤½¥q²M³æ"³o­Ósheet¸Ì¦Cªº¤½¥q,Åý"³]³Æ¦Cªí"³o­Ósheet¸Ì­±ªº³]³Æ¦Û°Ê¾ã¦CÅܦ⦨¬° ...
leirex1201 µoªí©ó 2015-5-8 18:27


¦UÃC¦â¥N½X~
¦bA1¶ñ¤WÃC¦â¡A·Æ¹«Â÷¶}A1²¾¦Ü¥ô¤@Àx¦s®æ«á¡AB1¥iÅã¥Ü¸ÓA1ÃC¦âªº¥N½X¡C

Q1¡JW7¬°¦UÃC¦â¥N½X¤@Äýªí¡C

¶È¨Ñ°Ñ¦Ò¡C

TOP

¤£¦n·N«ä~ÁÙ¤£¼ô±x¤¶­±ªº¾Þ§@~­«µo¤@¦¸^^"

¡y¦]¥»¨­¹ïÃC¦â¿ëÃѯà¤O¸û®z,¨ä±æ¥i¥H¦³¬ÛÀ³ªº¦â½X¥H¨Ñ¿ëÃÑ¡z

¦UÃC¦â¥N½X~
¦bA1¶ñ¤WÃC¦â¡A·Æ¹«Â÷¶}A1²¾¦Ü¥ô¤@Àx¦s®æ«á¡AB1¥iÅã¥Ü¸ÓA1ÃC¦âªº¥N½X¡C

Q1¡JW7¬°¦UÃC¦â¥N½X¤@Äýªí¡C

http://www.FunP.Net/469452

¶È¨Ñ°Ñ¦Ò¡C

TOP

¥»©«³Ì«á¥Ñ yen956 ©ó 2015-11-15 20:52 ½s¿è

1. ¦bModule1¤¤¶K¤W¤U¦CVBA
  1. Public colorNum As Integer

  2. '¥ý°õ¦æ¦¹VBA¤@¦¸, ¥H«Ø¥ß¥N½Xªí(Sheet1)
  3. Sub ÃC¦â¥N½Xªí()
  4.     Dim i As Integer
  5.     For i = 1 To 56
  6.         Sheets("Sheet1").Cells(i, 15) = i
  7.         Sheets("sheet1").Cells(i, 16).Interior.ColorIndex = i
  8.     Next
  9. End Sub
½Æ»s¥N½X
2. ¦bSheet2¤¤¤W¤U¦CVBA
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2.     If Target.Count > 1 Then Exit Sub
  3.     If Intersect(Target, [B:B]) Is Nothing Then Exit Sub
  4.     Target.Interior.ColorIndex = colorNum
  5. End Sub
½Æ»s¥N½X
3. ¦bSheet1¤¤¤W¤U¦CVBA
  1. '©|¥¼«Ø¥ß¥N½Xªí¥H«e, ¤£­n±Ò°Ê¦¹VBA
  2. '¥i¥ý±N Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  3. '§ï¦¨ Private Sub Worksheet_SelectionChange2(ByVal Target As Range)
  4. '«Ø¥ß§¹¥N½Xªí«á§Y¥i±Ò°Ê¦¹VBA, ¥Øªº¬O¨ú±o colorNum ªº­È
  5. '³Ì«á¦A¨ì sheet2 ¤¤,ÂIÄæBªº¦sÀx®æ, §Y¥i±o¨ì©Ò­nªºÃC¦â
  6. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  7.     If Target.Count > 1 Then Exit Sub
  8.     If Intersect(Target, [P1:P56]) Is Nothing Then Exit Sub
  9.     colorNum = Target.Interior.ColorIndex
  10. End Sub
½Æ»s¥N½X
´«¨¥¤§, ¥Î¨â­Ó Worksheet_SelectionChange ¨Ó¹F¦¨
test.gif

TOP

Sorry,¥þ³¡¶K¦b sheet1 ¤¤´N¥i¥H¤F
¥ÎUnion´N¥i¥H¤F
  1. Public colorNum As Integer

  2. '¥ý°õ¦æ¦¹VBA¤@¦¸, ¥H«Ø¥ß¥N½Xªí(Sheet1)
  3. Sub ÃC¦â¥N½Xªí()
  4.     Dim i As Integer
  5.     For i = 1 To 56
  6.         Cells(i, 15) = i
  7.         Cells(i, 16).Interior.ColorIndex = i
  8.     Next
  9. End Sub

  10. '©|¥¼«Ø¥ß¥N½Xªí¥H«e, ¤£­n±Ò°Ê¦¹VBA
  11. '«Ø¥ß§¹¥N½Xªí«á§Y¥i±Ò°Ê¦¹VBA
  12. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  13.     Dim rng As Range
  14.     If Target.Count > 1 Then Exit Sub
  15.     Set rng = Application.Union([B:B], [P1:P56])
  16.     If Intersect(Target, rng) Is Nothing Then Exit Sub
  17.     If Target.Column = 16 Then
  18.         colorNum = Target.Interior.ColorIndex
  19.     Else
  20.         Target.Interior.ColorIndex = colorNum
  21.     End If
  22. End Sub
½Æ»s¥N½X
test.gif

TOP

        ÀR«ä¦Û¦b : ­n§åµû§O¤H®É¡A¥ý·Q·Q¦Û¤v¬O§_§¹¬üµL¯Ê¡C
ªð¦^¦Cªí ¤W¤@¥DÃD