Find 'Missing Coverage' in Column, Then insert a comment in the same row but different column.

bmkelly

Board Regular
Joined
Mar 26, 2020
Messages
172
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am wanting to have the code look to find "Missing Coverage" in a Column that has a header of "Coverage", then when found I need to insert a comment in the same row but different column labeled "Analyst Notes".... Is there a way I can have this go through in a loop for each cell in the column "Coverage" to find "Missing Coverage" to then add a comment in a few columns over in the "Analyst Notes" cell?

Thanks
 
That is a significantly different question & will need a different approach. So I suggest that you start a new thread for this question.
Okay thank you again for the assistance! I have a feeling I will be posting a few threads within the next week-month!
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
That is a significantly different question & will need a different approach. So I suggest that you start a new thread for this question.

Oops, missed line it should be
VBA Code:
Sub bmkelly()
   Dim Ccol As Range, ANcol As Range
 
   Set Ccol = Range("1:1").Find("Coverage", , , xlWhole, , , False, , False)
   If Ccol Is Nothing Then
      MsgBox "Coverage column not found"
      Exit Sub
   End If
   Set ANcol = Range("1:1").Find("Analyst Notes", , , xlWhole, , , False, , False)
   If ANcol Is Nothing Then
      MsgBox "Analyst Notes column not found"
      Exit Sub
   End If
 
   With Ccol.EntireColumn
      .Replace "Missing Coverage", "=true", xlWhole, , False, , False, False
      On Error Resume Next
      .SpecialCells(xlFormulas, xlLogical).Offset(, ANcol.Column - .Column).Value = "Review - Missing Coverage"
      On Error GoTo 0
      .Replace "=true", "Missing Coverage", xlWhole, , False, , False, False
   End With
End Sub
Hey Fluff,

Just was wondering if we could add something to the code where it looks in the Coverage Column and if it says "Missing Coverage" it then looks in another column called "Transaction Type" and if it says "Addition" then add a note to the "Site Manager Notes" Column stating "Review - Missing Coverage Addition"

VBA Code:
Sub MissingCoverage()

'Looks for Missing Coverage in Coverage Column'

Dim CCol As Range
Dim SMNCol As Range
  
    Set CCol = Range("1:1").Find("Coverage", , , xlWhole, , , False, , False)
        If CCol Is Nothing Then
            MsgBox "Coverage Column Not Found"
        Exit Sub
        
    End If
   
    Set SMNCol = Range("1:1").Find("Site Manager Notes", , , xlWhole, , , False, , False)
        If SMNCol Is Nothing Then
            MsgBox "Site Manager Notes Column Not Found"
        Exit Sub
        
    End If
  
    With CCol.EntireColumn
        .Replace "Missing Coverage", "=true", xlWhole, , False, , False, False
            On Error Resume Next
        .SpecialCells(xlFormulas, xlLogical).Offset(, SMNCol.Column - .Column).Value = "Review - Missing Coverage"
            On Error GoTo 0
        .Replace "=true", "Missing Coverage", xlWhole, , False, , False, False
   End With
   
End Sub
 
Upvote 0
As that is also significantly different to your op, it needs a new thread.
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,741
Members
449,050
Latest member
excelknuckles

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
Back
Top