글 수 65
출처 : http://www.excellove.com/board/bbs/zboard.php?id=excel_tip&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=56
'******************************************************
'워크시트상 특정셀에서 바로가기(Ctrl+M)키를 누르고 입력
'상자로 간단히 메모를 삽입할 수 있습니다. 기존에 메모가
'작성되어있는 셀에서는 기존내용을 편집할 수 있습니다.
'******************************************************
'=============메모작성===============St
Sub 메모작성() '// 바로가기키 Ctrl+M로 지정
Dim strInput As String
Dim strCommect As String
On Error Resume Next
Application.DisplayCommentIndicator = xlCommentIndicatorOnly '//셀 팁은 숨기고 메모 표시기만 표시
Application.ScreenUpdating = False
If ActiveCell.Comment = True Then
strCommect = ActiveCell.Comment.Text '//기존메모입력받음
End If
strInput = InputBox("메모 내용을 입력하시오.", "메모입력", strCommect)
If strInput = "" Then Exit Sub '//내용없으면 종료
With ActiveCell
.ClearComments '//기존메모제거
.AddComment '//메모삽입
.Comment.Visible = True '//메모개체보이게
.Comment.Text Text:=strInput '//메모내용입력
End With
ActiveCell.Comment.Shape.Select '//메모개체선택(내용편집위함)
With Selection
.AutoSize = True '//자동크기
.Font.Name = "굴림" '//글씨체
.Font.FontStyle = "굵게" '//글씨굵게지정
.Font.Size = 9 '//클씨크기
'.Font.ColorIndex = xlAutomatic '//글씨색부여 기본색
.Font.ColorIndex = 3 '//빨간색
End With
ActiveCell.Comment.Visible = False '//메모 숨기기
End Sub
'=============메모작성===============Ed
과 같습니다.
더 다양한 기능을 추가하려면, 조금 더 복잡한 방법이 동원되어야 할 것 같습니다만...
'******************************************************
'워크시트상 특정셀에서 바로가기(Ctrl+M)키를 누르고 입력
'상자로 간단히 메모를 삽입할 수 있습니다. 기존에 메모가
'작성되어있는 셀에서는 기존내용을 편집할 수 있습니다.
'******************************************************
'=============메모작성===============St
Sub 메모작성() '// 바로가기키 Ctrl+M로 지정
Dim strInput As String
Dim strCommect As String
On Error Resume Next
Application.DisplayCommentIndicator = xlCommentIndicatorOnly '//셀 팁은 숨기고 메모 표시기만 표시
Application.ScreenUpdating = False
If ActiveCell.Comment = True Then
strCommect = ActiveCell.Comment.Text '//기존메모입력받음
End If
strInput = InputBox("메모 내용을 입력하시오.", "메모입력", strCommect)
If strInput = "" Then Exit Sub '//내용없으면 종료
With ActiveCell
.ClearComments '//기존메모제거
.AddComment '//메모삽입
.Comment.Visible = True '//메모개체보이게
.Comment.Text Text:=strInput '//메모내용입력
End With
ActiveCell.Comment.Shape.Select '//메모개체선택(내용편집위함)
With Selection
.AutoSize = True '//자동크기
.Font.Name = "굴림" '//글씨체
.Font.FontStyle = "굵게" '//글씨굵게지정
.Font.Size = 9 '//클씨크기
'.Font.ColorIndex = xlAutomatic '//글씨색부여 기본색
.Font.ColorIndex = 3 '//빨간색
End With
ActiveCell.Comment.Visible = False '//메모 숨기기
End Sub
'=============메모작성===============Ed
과 같습니다.
더 다양한 기능을 추가하려면, 조금 더 복잡한 방법이 동원되어야 할 것 같습니다만...