Win32 and Excel question

pekka niiranen krissepu at vip.fi
Wed Apr 10 07:36:21 EDT 2002


Try this link

    http://examples.oreilly.com/pythonwin32/

-pekka-

Matthew wrote:

>Hi,
>I'm playing with win32COM with a little success. I have a large XL table
>with 8 columns and about 3500 rows. What I want to do is search only
>column B for a value and return the row number where this value is
>found. So, I have 2 questions:-
>1) Howto construct a Win32COM statement to do this? So far I have this:-
>
>found=myxl.ActiveSheet.Range("B1:B3500").Find(<value_i'm_looking_for>
>However, this search finds the first match in any column between B1 and
>B3500. Yep, their are similar values in other cells of the s/s
>
>>>>found.Row
>>>>
>25
>
>>>>found.Column
>>>>
>1 (ie: Column 'A')
>Help please.
>2) Howto return a tuple of all values in only column 'B' and then use
>python to search the tuple for the value I'm after. It strikes me that
>this is probably a faster approach?
>Thanks for helping. matthew.
>BTW: Thanks Mark Hammond for a v.cool and useful tool.
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20020410/07a1fe85/attachment.html>


More information about the Python-list mailing list