xlsxwriter conditional format: find the exactly value
<p>this is my code:</p>

<pre><code>        import xlsxwriter

        for val in arr:
        sheet.conditional_format('B2:B2000', {'type':     'text',
                                        'criteria': 'containingwith',
                                        'value':  val,
                                        'format':   formatOk})
</code></pre>

<p>and my question is: how i get the exactly value. for example:<br>
if my values in excel are: aaa,aab,aa. and my val is:aa, so the result will be only aa.
and other question: how i get the number of my column in this part: B2:B2000, and no writing a random value.
thanks.</p>

<p>Something like the following should work:</p>

<pre><code>worksheet1.conditional_format('B2:K12', {'type':     'cell',
                                         'criteria': '==',
                                         'value':    '"aa"',
                                         'format':   format1})
</code></pre>

<p><strong>Update</strong>: Working example:</p>

<pre><code>import xlsxwriter

workbook = xlsxwriter.Workbook('conditional_format.xlsx')
worksheet = workbook.add_worksheet()

# Add a format.
my_format = workbook.add_format({'bg_color': '#FFC7CE',
                                 'font_color': '#9C0006'})

# Add some data to the sheet.
data = [
    ['Foo', 'Mood', 'Fool', 'Foo'],
    ['Boo', 'Mood', 'Bool', 'Boo'],
    ['Goo', 'Good', 'Gool', 'Foo'],
    ['Foo', 'Food', 'Fool', 'Zoo'],
]

for row, row_data in enumerate(data):
    worksheet.write_row(row, 0, row_data)

# Add a conditional format.
worksheet.conditional_format('A1:D4', {'type':     'cell',
                                       'criteria': '==',
                                       'value':    '"Foo"',
                                       'format':   my_format})

# Close the file.
workbook.close()
</code></pre>

<p>Output:</p>

<p><a href="http://i.stack.imgur.com/zlx5N.png" rel="nofollow"><img src="http://i.stack.imgur.com/zlx5N.png" alt="enter image description here"></a></p>

python