Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Converts docstring column into comments on name column

Private Sub Workbook_AfterXmlImport(ByVal Map As XmlMap, ByVal IsRefresh As Boolean, ByVal Result As XlXmlImportResult)     If Map.Name <> "application_Map" Then Exit Sub     Dim cel As Range, ws As Worksheet, rng As Range     Set ws = ThisWorkbook.Worksheets("Sheet1")     Set rng = ws.ListObjects(1).ListColumns("name").Range     For Each cel In rng         If Not (cel.Comment Is Nothing) Then cel.Comment.Delete         cel.AddComment cel.Offset(0, 1).Text         rowID = cel.Row - rng.Row     Next End Sub