Insert 500 comments from a list into 500 cells in a column

MixedUpExcel

Board Regular
Joined
Apr 7, 2015
Messages
222
Office Version
  1. 365
Platform
  1. Windows
Hi,

Can someone please help me with a macro for this.

If I have a list of 500 comments (simply as text in cells) in a spreadsheet (sheet 2, A1 to A500), how can I take those (automatically) and insert them as comments into Sheet 1, C15 to C514?

Sheet 1 is password protected but if that's a problem, I can manually remove the password whilst I run the macro to insert the comments.

Thanks in advance for any help with this.

Simon
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Yes, unprotecting Sheet1 will help this macro run.
Code:
Sub test()
    Dim i As Long
    For i = 0 To 499
        Sheets("Sheet1").Range("C15").Offset(i, 0).NoteText Text:=Sheets("Sheet2").Range("A1").Offset(i, 0).Text
    Next i
End Sub
 
Upvote 0
Hi Mike,

Thanks for the quick response on this.

Works just how I'd hoped.

Appreciate your time on this.

Simon
 
Upvote 0
Just a thought Mike,

If my list of 500 (on Sheet 2) was broken, as in not all 500 cells had a comment which needed to be inserted on Sheet 1 (this would correspond with data I already had on Sheet 1) is there a way for me to get the loop to skip rows?

I was looking at something like the below but can't get it to work:

Code:
Sub test()


    Dim i As Long
    For i = 0 To 100
    
    If Not Sheets("Sheet2").Range("A" & i).Value = "" Then
    
        Sheets("Sheet1").Range("C15").Offset(i, 0).NoteText Text:=Sheets("Sheet2").Range("A1").Offset(i, 0).Text
    
    Else
    
    End If
    
    Next i
   
End Sub

Any suggestions please or am I looking at this the wrong way?

Thanks.

Simon
 
Upvote 0
I think I've got it working with this:

Code:
Sub test()


    Dim i As Long
    For i = 0 To 100
    
    If Not IsEmpty(Sheets("Sheet2").Range("A" & i + 1).Value) Then
    
        Sheets("Sheet1").Range("C15").Offset(i, 0).NoteText Text:=Sheets("Sheet2").Range("A1").Offset(i, 0).Text
    
    End If
    
    Next i
   
End Sub

Thanks.
 
Upvote 0

Forum statistics

Threads
1,214,981
Messages
6,122,566
Members
449,089
Latest member
Motoracer88

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