user5500328
user5500328

Reputation: 61

Copy text from cell from a WS to a comment box from another WS

I just need help with making a VBA that automatically copies all entries from sheet1 cell E2:E32 to sheet2 cell C347:Y347 as a comment.

For example, If I type a text on cell E2 on sheet1 it will automatically paste it on cell C347 sheet2 as a comment. Is that possible?

Upvotes: 1

Views: 39

Answers (1)

cboden
cboden

Reputation: 823

In the worksheet change eventhandler for Sheet1:

Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 5 And Target.Row >= 2 And Target.Row <= 32 Then
        With Worksheets("Sheet2").Cells(347, Target.Row + 1)
            If .Comment Is Nothing Then .AddComment
            .Comment.Text Target.Value & vbNewLine & .Comment.Text
        End With
    End If
End Sub

Upvotes: 1

Related Questions