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

[µo°Ý] §ïÅÜÀx¦s®æÃC¦â

[µo°Ý] §ïÅÜÀx¦s®æÃC¦â

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Application.CutCopyMode = xlCopy Then Me.Paste
On Error Resume Next
[colorCell].FormatConditions.Delete
Target.Name = "colorCell"
With [colorCell].FormatConditions ' ³]©w®æ¦¡¤Æ±ø¥ó
.Delete        ¡@        ¡@
.Add xlExpression, , "TRUE" ' ±ø¥ó(¤@)¤º¤½¦¡¬°
.Item(1).Interior.ColorIndex = 40 ' .Item(1)µ¥©óFormatConditions(1)
.Item(1).Font.Bold = True
End With        ¡@        ¡@
End Sub        ¡@        ¡@
¤W­zµ{¦¡¬Oºô¸ô¤W©Ò¼gªºµ{¦¡
¡@        ¡@        ¡@        ¡@
­Y·Æ¹«²¾¨ì"ªí®æ¤º¤w³]©w®æ¦¡¤Æ±ø¥óªºÀx¦s®æ"ªº¦ì¸m®É¡A¤£·|§ïÅÜ­ì®æ¦¡¤Æªº±ø¥ó
³]©w(¥u¬O§ïÅÜÃC¦â¦Ó¤w)¡C
½Ð±Ð°ª¤â­n¦p¦ó§ï¼g¤W­zµ{¦¡¡C

Àx¦s®æÃC¦â§ïÅÜ.zip (10.9 KB)

¦^´_ 1# Hyuan


­Y·Æ¹«²¾¨ì"ªí®æ¤º¤w³]©w®æ¦¡¤Æ±ø¥óªºÀx¦s®æ"ªº¦ì¸m®É¡A¤£·|§ïÅÜ­ì®æ¦¡¤Æªº±ø¥ó
³]©w(¥u¬O§ïÅÜÃC¦â¦Ó¤w)¡C

¨þ¨þ¡A§Aªº°ÝÃD«Ü¦³·N«ä!
¤£ºÞÀx¦s®æ®æ¦¡¬O¤°»òÃC¦â¡A®æ¦¡¤Æ±ø¥óªº®ÄªG·|Âл\±¼­ì¥»ªºÀx¦s®æ®æ¦¡
©Ò¥H§A­n§ïÅܦ³®æ¦¡¤Æ±ø¥óªºÀx¦s®æÃC¦â¡A¥²¶·¥ý²¾°£¸Ó®æªº®æ¦¡¤Æ±ø¥ó
¦ý¬O³o¼Ë´N·|¤£ª¾¹D·íªìªº®æ¦¡¤Æ±ø¥ó¡A©Ò¥H­n¥ý½Æ»s®æ¦¡¤Æ±ø¥ó¨ì¨ä¥¦®æ


¶¶§Ç¦p¤U:
1.½Æ»sÂI¿ïªº®æ¦¡¤Æ±ø¥ó¨ì¬Y¤@®æ(§Úªºµ{¦¡¬O³Ì«á¤@®æ)
2.§R°£ÂI¿ïªº®æ¦¡¤Æ±ø¥ó
3.¬°ÂI¿ïªºÀx¦s®æ¤WÃC¦â
4.·íÂI¨ì¨ä¥¦Àx¦s®æ®É¡A§â³Ì«á¤@­Óªº®æ¦¡¤Æ±ø¥ó½Æ»s¦^¤W¤@®æ


µ{¦¡¦p¤U:
Dim pre As Range
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
If Application.CutCopyMode = xlCopy Then Me.Paste
On Error Resume Next
If Not pre Is Nothing Then
  Cells(Rows.Count, Columns.Count).Copy
  pre.PasteSpecial Paste:=xlPasteFormats
End If
Target.Copy
Cells(Rows.Count, Columns.Count).PasteSpecial Paste:=xlPasteFormats
Application.CutCopyMode = False: Target.Select
Target.FormatConditions.Delete
Target.Interior.ColorIndex = 40
Set pre = Target
Application.EnableEvents = True
End Sub
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 2# n7822123

ÁÂÁ¤j¤jªºÀ°¦£¡C§¹¥þ²Å¦X§Úªº»Ý¨D¡A¦ý¬O§Úµo²{¥t¤@­Ó°ÝÃD:
·í´å¼Ð²¾°Ê¨ìÀx¦s®æ®É¤ÏÀ³¦³ÂIºC¤£¦ÛµM(¦n¹³¦b¹B§@¤@ª½¦b¥´°é°é¡A¦pªG¸ê®Æ¦h®É§óºC)¡C
¦A½Ð±Ð¤j¤j¸Ñ¨M¡C

TOP

¦^´_ 3# Hyuan


§Ú¦Û¤v¹Á¸Õ¡A¨S¦³³o­Óª¬ªp­C¡A

À³¸Ó¬O§A¦³¤£¤Ö¨ç¼ÆIJµo¦Û°Ê­«ºâ¡A¥[¤W³o¨â¦æ¸Õ¸Õ

Dim pre As Range
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlManual
If Application.CutCopyMode = xlCopy Then Me.Paste
On Error Resume Next
If Not pre Is Nothing Then
  Cells(Rows.Count, Columns.Count).Copy
  pre.PasteSpecial Paste:=xlPasteFormats
End If
Target.Copy
Cells(Rows.Count, Columns.Count).PasteSpecial Paste:=xlPasteFormats
Application.CutCopyMode = False: Target.Select
Target.FormatConditions.Delete
Target.Interior.ColorIndex = 40
Set pre = Target
Application.EnableEvents = True
Application.Calculation = xlAutomatic
End Sub
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-12-5 13:06 ½s¿è

¦^´_ 4# n7822123

µo²{¤pBUG¡AÃö±¼¦Û°Ê­«ºâ·|Åý¦Û°Ê¶K¤W¥¢®Ä
­×§ï¤@¤U¶¶§Ç

Dim pre As Range
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
On Error Resume Next
If Application.CutCopyMode = xlCopy Then Me.Paste
Application.Calculation = xlManual

If Not pre Is Nothing Then
  Cells(Rows.Count, Columns.Count).Copy
  pre.PasteSpecial Paste:=xlPasteFormats
End If
Target.Copy
Cells(Rows.Count, Columns.Count).PasteSpecial Paste:=xlPasteFormats
Application.CutCopyMode = False: Target.Select
Target.FormatConditions.Delete
Target.Interior.ColorIndex = 40
Set pre = Target
Application.EnableEvents = True
Application.Calculation = xlAutomatic
End Sub
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 5# n7822123

¦A¦¸ÁÂÁ¤j¤jªºÀ°¦£¡A¸Ñ¨M¤F§Úªº°ÝÃD¡C

TOP

        ÀR«ä¦Û¦b : ºÉ¦h¤Ö¥»¥÷¡A´N±o¦h¤Ö¥»¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD