Assist need with copy/paste cells for isolated notes macro

ddutton

New Member
Joined
Jan 9, 2020
Messages
14
Office Version
  1. 365
Platform
  1. Windows
The current code is isolating notes created. Need to copy paste two additional cells in the row where the note is located. Any assistance would be greatly appreciated. The data in the active sheet, columns "D" and "F" are where the "CONFIGURATION INSTANCE" & "SUPPORT GROUP" are located.

VBA Code:
Sub LIST_NOTES()
Dim liComment As Comment
Dim i As Integer
Dim ws As Worksheet
Dim ComSh As Worksheet
Set ComSh = ActiveSheet
If ActiveSheet.Comments.Count = 0 Then Exit Sub

For Each ws In Worksheets
  If ws.Name = "Comments" Then i = 1
Next ws
   
If i = 0 Then
  Set ws = Worksheets.Add(After:=ActiveSheet)
  ws.Name = "AFTER ACTION REPORTING"
Else: Set ws = Worksheets("Comments")
End If

For Each liComment In ComSh.Comments
  ws.Range("A1").Value = "LOCATED IN CELL"
  ws.Range("B1").Value = "AUTHOR"
  ws.Range("C1").Value = "NOTE"
  ws.Range("D1").Value = "CONFIGURATION INSTANCE"
  ws.Range("E1").Value = "SUPPORT GROUP"
 
  With ws.Range("A1:E1")
    .Font.Bold = True
    .Interior.Color = RGB(189, 215, 238)
    .Columns.ColumnWidth = 40
  End With
  If ws.Range("A2") = "" Then
    ws.Range("A2").Value = liComment.Parent.Address
    ws.Range("B2").Value = Left(liComment.Text, InStr(1, liComment.Text, ":") - 1)
    ws.Range("C2").Value = Right(liComment.Text, Len(liComment.Text) - InStr(1, liComment.Text, ":"))
  Else
    ws.Range("A1").End(xlDown).Offset(1, 0) = liComment.Parent.Address
    ws.Range("B1").End(xlDown).Offset(1, 0) = Left(liComment.Text, InStr(1, liComment.Text, ":") - 1)
    ws.Range("C1").End(xlDown).Offset(1, 0) = Right(liComment.Text, Len(liComment.Text) - InStr(1, liComment.Text, ":"))
  End If
Next liComment
End Sub
 
Last edited by a moderator:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
65,942
Office Version
  1. 365
Platform
  1. Windows
How about
VBA Code:
    ws.Range("D2").Value = ComSh.Range("D" & liComment.Parent.Row)
    ws.Range("E2").Value = ComSh.Range("F" & liComment.Parent.Row)
 

ddutton

New Member
Joined
Jan 9, 2020
Messages
14
Office Version
  1. 365
Platform
  1. Windows
YES!.. thank you so much.. works perfectly.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
65,942
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Forum statistics

Threads
1,148,193
Messages
5,745,272
Members
423,941
Latest member
CluelessAboutExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top