當前位置:編程學習大全網 - 網站源碼 - EXCEL表格 如何使某表格李的的批註顯示另外幾個表格的數據

EXCEL表格 如何使某表格李的的批註顯示另外幾個表格的數據

因為不知道妳要顯示批註的具體單元格和那6個數據的具體單元格,所以我在此假設要在A1顯示批註,批註來源是A10:B12,請妳根據自己的具體情況適當更改。步驟如下:

ALT+F11,輸入如下代碼:

Private?Sub?Worksheet_Change(ByVal?Target?As?Range)

Dim?strcomment?As?String

strcomment?=?Range("A10").Text?&?":"?&?Range("B10").Text?&?Chr(13)?&?Chr(10)?&?Range("A11").Text?&?":"?&?Range("B11").Text?&?Chr(13)?&?Chr(10)?&?Range("A12").Text?&?":"?&?Range("B12").Text

If?Range("A1").Comment?Is?Nothing?Then

Range("A1").AddComment

Range("A1").Comment.Visible?=?True

Range("A1").Comment.Text?Text:=strcomment

Else

Range("A1").Comment.Visible?=?True

Range("A1").Comment.Text?Text:=strcomment

End?If

End?Sub

如下圖所示:

  • 上一篇:原始玉尊最後結局
  • 下一篇:JAVA中能夠實現方法的遞歸調用嗎?如何實現?
  • copyright 2024編程學習大全網