Methods
AddComment   메모 추가
 ActiveCell.AddComment("내용")
ClearComments   메모를 삭제 (메모가 없어도 에러발생 안됨)
 ActiveCell.ClearComments
Delete   메모를 삭제 (메모가 없으면 에러발생)
 ActiveCell.Comment.Delete
Next   선택된 Cell의 메모의 다음 메모를 선택하는데 메모가 있는곳 찾아서 선택
 (선택된 Cell에 메모가 없거나 다음 메모가 없으면 에러발생)
 ActiveCell.Comment.Next.Delete
Previous   선택된 Cell의 메모의 이전 메모를 선택하는데 메모가 있는곳 찾아서 선택
 (선택된 Cell에 메모가 없거나 이전 메모가 없으면 에러발생)
 ActiveCell.Comment.Previous.Delete
Text   메모를 수정 (메모가 없으면 에러발생)
 ActiveCell.Comment.Text ("수정")
Chr(10)   메모의 줄바꿈
 ActiveCell.Comment.Text ("수정" & Chr(10) & "다음칸")
--------- --------- --------- --------- --------- --------- --------- --------- --------- 
Properties
Shape <상세  메모의 모양을 나타냄
 ActiveSheet.Comments(2).Shape.Select
Visible = True/False   메모의 표시되는지 여부를 결정함
 ActiveCell.Comment.Visible = True
셀에 메모가 있는지 여부 판단   If Not (Range("e" & i).Offset(0, Range("b6")).Comment Is Nothing) Then
메모에 엔터값이 있는지 여부 판단   If InStr(Range("e" & i).Comment.Text, Chr(10)) > 0 Then

 

 

형식
Comment.Shape.xxx <이전
Comment.Shape.TextFrame.Characters.Font.Bold = True/False   메모의 글씨 굵게
 ActiveCell.Comment.Shape.TextFrame.Characters.Font.Bold = true
Comment.Shape.TextFrame.Characters.Font.Size   메모의 글씨 크기
 ActiveCell.Comment.Shape.TextFrame.Characters.Font.Size = 12
Comment.Shape.TextFrame.Characters.Font.Color   메모의 글씨색을 변경
 ActiveCell.Comment.Shape.TextFrame.Characters.Font.Color = vbRed
Comment.Shape.TextFrame.Characters.Font.ColorIndex   메모의 글씨색을 숫자로 변경, 56까지
 ActiveCell.Comment.Shape.TextFrame.Characters.Font.ColorIndex = 7
Comment.Shape.Fill.ForeColor.RGB = RGB(R값, G값, B값)   메모의 배경색을 변경
 ActiveCell.Comment.Shape.Fill.ForeColor.RGB = RGB(0, 0, 255)
Comment.Shape.Fill.ForeColor.SchemeColor   메모의 배경색을 숫자로 변경, 80까지
 ActiveCell.Comment.Shape.Fill.ForeColor.SchemeColor = 7
Comment.Shape.Height   메모박스 높이
 ActiveCell.Comment.Shape.Height = 9
Comment.Shape.Width   메모박스 너비
 ActiveCell.Comment.Shape.Width = 9
Comment.Shape.Top   메모박스 위에서부터 거리
 ActiveCell.Comment.Shape.Top = 9
Comment.Shape.Left   메모박스 왼쪽에서부터 거리
 ActiveCell.Comment.Shape.Left = 9

 

출처: Microsoft/Docs/Office VBA Reference/Excel

'링크 > VBA' 카테고리의 다른 글

Application  (0) 2021.12.04
Sort  (0) 2021.12.04
Borders  (0) 2021.12.04
Font  (0) 2021.12.04
Range  (0) 2021.12.04

+ Recent posts