材料/工具
Microsoft Office 2007
方法
按下Alt+F11進入VB編輯器,雙擊左側 的“Thisworkbook”,進入編輯。
粘貼以下代碼:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Application.CutCopyMode = xlCopy And n = 1 Then n = 0: End
Cells.Interior.ColorIndex = 0
Target.EntireRow.Interior.ColorIndex = 34
Target.EntireColumn.Interior.ColorIndex = 34
End Sub
點擊儲存按鈕或Ctrl+s,如果提示警告選擇確定。
然後就完成了!