Example: Adding Cell Comments to Worksheets (Simple)

A simple example of adding cell comments to a worksheet. For more details see Working with Cell Comments.

_images/comments1.png

Code:

###############################################################################
#
# An example of writing cell comments to a worksheet using Python and
# XlsxWriter.
#
# For more advanced comment options see comments2.py.
#
# Copyright 2013, John McNamara, jmcnamara@cpan.org
#
from xlsxwriter.workbook import Workbook

workbook = Workbook('comments1.xlsx')
worksheet = workbook.add_worksheet()

worksheet.write('A1', 'Hello')
worksheet.write_comment('A1', 'This is a comment')

workbook.close()

Previous topic

Example: Adding Headers and Footers to Worksheets

Next topic

Example: Adding Cell Comments to Worksheets (Advanced)

This Page