Can selected cell comments be printed out?

krisco73

New Member
Joined
Mar 17, 2003
Messages
30
I have a sheet containing several comments inserted into cells. Column "F" in this sheet has been used for inserting comments which provide the reference documentation used in answering the question in column "D". (example: Websters Dictionary Version 2.1.4, 1998)

If I select "at end of sheet", in the page setup menu, all of the comments print out, how do I show only the comments for column "F"?

OR

can I link comments to cells at the botto of the sheet?

Thanxs in advance

kris
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
If you run this macro it will place comments in column F in column G (if you have data in column G change the offset(0,1) to (0,2) or 3 (2= column H, 3= I etc.)

Code:
Sub test()
Dim c As Range
On Error Resume Next
For Each c In Range("F1:F" & Range("D65536").End(xlUp).Row)
c.Offset(0, 1).Value = c.Comment.Text
'if you have data in column G change 1
Next c
End Sub
 
Upvote 0
You could use this custom function to get the comment text:

Code:
Function GetComment(Rng As Range) As Variant
    Dim x As String
    On Error Resume Next
    x = Rng.Comment.Text
    If Err = 0 Then
        GetComment = WorksheetFunction.Clean(x)
    Else
        GetComment = CVErr(xlErrNA)
    End If
End Function

Press Alt+F11 to go to the VBE. Click your workbook in the Project window and choose Insert|module from the menu. Paste the code into the window on the right. Press Alt+F11 to return to your workbook.

You can use the function in a cell like this:

=GetComment(F1)
 
Upvote 0
I tried both of the codes returned to me and they both work. I am going to utilize the GetComment command in other spreadsheets as well. That command should be a standard excel function.

Thanks a million

K
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,864
Members
449,052
Latest member
Fuddy_Duddy

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