Win32 and Excel question

Matthew matthewm at ihug.co.nz
Wed Apr 10 04:04:48 EDT 2002


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.





More information about the Python-list mailing list