Excel에 주석 나열

Excel에 주석 나열

하나의 탭에 워크시트의 모든 메모를 나열하는 방법은 무엇입니까?

이것이 가능하다는 것을 알고 있지만 어떻게 해야 할지 모르겠습니다. 사용하기 쉽도록 워크시트에 포함된 모든 의견을 페이지로 인쇄하고 싶습니다. 어떤 아이디어??

답변1

나는 이미 당신이 요청한 것을 거의 수행하는 기능을 가지고 있으므로 약간만 조정했습니다. 이 매크로( listComments2)가 그 역할을 할 것입니다.

Sub listComments2()
'Thanks to http://superuser.com/a/809212/529100
Dim commentWS As Worksheet

Application.ScreenUpdating = False

Set commentWS = ActiveWorkbook.Worksheets.Add(after:=ActiveWorkbook.Worksheets(Sheets.Count))
commentWS.Name = "Comments"

Dim cmts As New Collection

For Each ws In ActiveWorkbook.Worksheets
    If ws.Name <> "Comments" Then
        For Each cmt In ws.Comments
            cmts.Add cmt.Text
        Next cmt
    End If
Next ws

Dim commentArray() As Variant
commentArray = toArray(cmts)

Dim i As Long
For i = LBound(commentArray) To UBound(commentArray)
    With commentWS
        .Cells(i, 1).Value = commentArray(i)
    End With
Next i

' Reformat columns/worksheet
With commentWS.Cells
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlBottom
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    .EntireColumn.AutoFit
End With

Application.ScreenUpdating = True

End Sub


Function toArray(cmt As Collection)

Dim i As Long
Dim arr() As Variant
ReDim arr(1 To cmt.Count) As Variant
For i = 1 To cmt.Count
    arr(i) = cmt(i)
Next i

toArray = arr
End Function

관련 정보