Trying to get dynamic comments (threaded comments are preferred)

Austinkane6690

New Member
Joined
Aug 23, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
What I have happening outside the macro already:

sheet 1 is explicit except when sheet 2 is mentioned

This is inside cell h3 of sheet 1:

If(and(f3=“specific text”,f5=“other specific text”),”value of cell h3 from sheet 2” ,

If(same thing but with different texts, value of cell i3 from sheet 2”
And so on and so forth across 13 columns and 31 rows from sheet 2


Basically, what I want to happen:
If the value of cell h3 on sheet 1 is equal to the value of cell h3 on sheet 2, I want a comment added for h3 on sheet 1 that contains the contents of cell a3 of sheet 2



All of this to be applied from h3 to h33 of sheet 1

I have the following macros that I’ve been trying and failing to adjust to my needs. I am not the best at code, but I can mimic other peoples’ code. Not very useful except when I want to self help.
But I can’t self help because I’m not understanding entirely





Sub ValueToComment()

Dim rCell As Range

For Each rCell In Selection

With rCell

If .HasFormula Then

On Error Resume Next

.Comment.Delete

On Error GoTo 0

.AddComment

.Comment.Text Text:=CStr(rCell.Value)

End If

End With

Next

Set rCell = Nothing

End Sub





Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Count > 1 Then Exit Sub

If Intersect(Target, Range("D11:E20")) Is Nothing Then Exit Sub

Dim i As Integer

Dim j As Integer

Dim cmt As Comment

i = Target.Row

j = Target.Column

With Worksheets("Classify")

' Determine Column modified by User

Select Case j

'Re-compose Items Comments in Classify worksheet

Case 4

.Cells(18, i).Comment.Text Text:=Target.Value & Chr(10) & Target.Offset(0, 1)

Case 5

.Cells(18, i).Comment.Text Text:=Target.Offset(0, -1) & Chr(10) & Target.Value

End Select

' Define Comment and Bold first segment

Set cmt = .Cells(18, i).Comment

With cmt.Shape.TextFrame

.Characters.Font.Bold = False

.Characters(1, InStr(1, cmt.Text, Chr(10))).Font.Bold = True

End With

End With

End Sub
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,214,987
Messages
6,122,614
Members
449,090
Latest member
vivek chauhan

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