Re: [算表] 能夠讓底色隨另一個格子變動嗎?

看板Office作者 (wormsing)時間15年前 (2010/08/07 21:35), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串2/2 (看更多)
※ 引述《kerno ()》之銘言: : 軟體:excel2007 : 假設A1的底色是藍色 : A2要讓他的底色跟A1一樣 (即藍色) : 下次A1改成黃色的時候 : A2就會自動變成跟A1一樣的黃色 : 有辦法這樣作嗎?@@ : 謝謝 開啟 Visual Basic 編輯器 在畫面左側 Microsoft Excel 物件中 選取你想編輯的sheet 假設為 Sheet(Sheet1) 滑鼠左鍵點兩下,在右側編輯區貼入下列程式碼: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Range("A2").Interior.ColorIndex <> Range("A1").Interior.ColorIndex Then Range("A2").Interior.ColorIndex = Range("A1").Interior.ColorIndex End If End Sub -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 124.9.23.46

08/08 13:48, , 1F
可以了 多謝^^
08/08 13:48, 1F
文章代碼(AID): #1CNM4xdS (Office)
文章代碼(AID): #1CNM4xdS (Office)