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

[µo°Ý] VBAÂI¿ïÀx¦s®æ«ü©w½d³ò¦Û°Ê¤Ï¦â

¦^´_ 10# Hyuan


Á|´X­Ó¹ê¨Ò»¡©ú, ³Ì¦n¦A¤W¶Ç¼ÒÀÀÀÉ®×!!

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-12-9 15:46 ½s¿è

¦^´_ 10# Hyuan

¬O³o¼Ë¶Ü? ¬õ¦â¦r³¡¤À½Ð¦Û¦æ§ó§ï!
§Ú¨S¦³¥Î¨ì©w¸q¦WºÙªº³¡¤À

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set ½d³ò = [C4:H10]   '½Ð¦Û¦æ§ó§ï­nÅܦâ½d³ò¡A¤U­±µ{¦¡ªºÃC¦â¤]¦Û¦æ§ó§ï
If Intersect(Target, ½d³ò) Is Nothing Then Exit Sub '¿ï¨ú½d³ò»P³]©w½d³òµL¥æ¶°«hÂ÷¶}
½d³ò.Interior.ColorIndex = -4142 '¥ý«ì´_µLÃC¦â
For Each rg In Target  '³v¤@½T»{¿ï¨úªº½d³ò¡A­Y¦b³]©w½d³ò¤º«h¾ã¦CÅܦâ(¿ï¨úªº½d³ò¦³¥i¯à¦b³]©w½d³ò¥~)
  If Not Intersect(rg, ½d³ò) Is Nothing Then Cells(rg.Row, ½d³ò(1).Column).Resize(, ½d³ò.Columns.Count).Interior.Color = RGB(100, 255, 255)
Next
Intersect(Target, ½d³ò).Interior.Color = RGB(255, 0, 0) '³v¤@½T»{¿ï¨úªº½d³ò¡AµM«áÅܦâ
End Sub

Àx¦s®æÅܦâ.rar (11.11 KB)
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 11# ­ã´£³¡ªL

ªþ¤Wªþ¥ó
½Ð±Ð­ã¤j­n¦p¦ó°µ¨ì¦pªþ¥óªºµe­±¡C
ÁÂÁ§A¡C

TT20170225-02(¿ï¨úÀx¦s®æ,¦CÅܦâ).zip (9.94 KB)

TOP

¦^´_ 11# ­ã´£³¡ªL
ªí¹F¤£§¹¾ã¡A­ìªþ¥ó§@¼o¡C

TT20170225-02(¿ï¨úÀx¦s®æ,¦CÅܦâ).zip (9.95 KB)

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-12-9 20:23 ½s¿è

¦^´_ 14# Hyuan

¬õ¦â¦r³¡¤À¡A¥i¦Û¦æ§ó§ï

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set ½d³ò = [I7:O18]   '½Ð¦Û¦æ§ó§ï­nÅܦâ½d³ò¡A¤U­±µ{¦¡ªºÃC¦â¤]¦Û¦æ§ó§ï
If Intersect(Target, ½d³ò) Is Nothing Then Exit Sub '¿ï¨ú½d³ò»P³]©w½d³òµL¥æ¶°«hÂ÷¶}
½d³ò.Interior.ColorIndex = -4142 '¥ý«ì´_µLÃC¦â
For Each rg In Target  '³v¤@½T»{¿ï¨úªº½d³ò¡A­Y¦b³]©w½d³ò¤º«h¾ã¦CÅܦâ(¿ï¨úªº½d³ò¦³¥i¯à¦b³]©w½d³ò¥~)
  If Not Intersect(rg, ½d³ò) Is Nothing Then Cells(rg.Row, ½d³ò(1).Column).Resize(, ½d³ò.Columns.Count).Interior.Color = RGB(255, 255, 0)
  If Not Intersect(rg, ½d³ò) Is Nothing Then Cells(½d³ò(1).Row, rg.Column).Resize(½d³ò.Rows.Count).Interior.Color = RGB(255, 255, 0)
Next
Intersect(Target, ½d³ò).Interior.Color = RGB(255, 0, 0) '½T»{¿ï¨úªº½d³ò¡AµM«áÅܦâ
End Sub

TT20170225-02(¿ï¨úÀx¦s®æ,¦CÅܦâ)+1.rar (9.18 KB)
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 12# n7822123
ÁÂÁ¤j¤j¹©¤OÀ°¦£¡C
§Æ±æÀx¦s®æ©Ò¦bªº[¦æ]¤]¦³ÃC¦â¡A¦pªþ¥ó¡C

Àx¦s®æÅܦâ.zip (7.66 KB)

TOP

¦^´_ 16# Hyuan


  ¤w¦^ÂЧA¤F¡A¤W¤W¼Ó
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim xA As Range, SelArea As Range, xR As Range
Set xA = [I7:O18]: xA.Interior.ColorIndex = 0
Set SelArea = Intersect(xA, Target)
If SelArea Is Nothing Then Exit Sub
For Each xR In SelArea
   xA.Rows(xR.Row - xA.Row + 1).Interior.Color = vbYellow
   xA.Columns(xR.Column - xA.Column + 1).Interior.Color = vbYellow
Next
SelArea.Interior.Color = vbRed
End Sub

TOP

´ê¤@¸} °Ñ¦Ò¬Ý¬Ý
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2.     Dim xA As Range, xR As Range
  3.     Set xA = [I7:O18]
  4.     xA.Interior.ColorIndex = 0
  5.     If Intersect(xA, Target) Is Nothing Then Exit Sub
  6.     For Each xR In xA.Columns
  7.         If Not Intersect(xR, Target) Is Nothing Then xR.Interior.Color = vbYellow
  8.     Next
  9.     For Each xR In xA.Rows
  10.         If Not Intersect(xR, Target) Is Nothing Then xR.Interior.Color = vbYellow
  11.     Next
  12.     Target.Interior.Color = vbRed
  13. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 19# GBKEE

«Ü·PÁÂn¤j¡B­ã¤j¡BG¤j¤T¦ì¹©¤O¬Û§U¡C·PÁÂ~~~

¤]·PÁ¦³¯u»ò¦nªº°Q½×¶é¦a¡C

TOP

        ÀR«ä¦Û¦b : «H¤ß¡B¼Ý¤O¡B«i®ð¤TªÌ¨ã³Æ¡A«h¤Ñ¤U¨S¦³°µ¤£¦¨ªº¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD