Page 1 of 1

Better way to search thru cells?

Posted: Fri Sep 19, 2008 4:46 pm
by cherkey
Hello,
There has to be a better way to do this...a more efficient way..
I have a number entered from an Inputbox that I'm looking for within a column of cells. Right now I'm just using and if..then - I look at a specific cell and if it's not the number I move to the next cell and so on until I find the number. Is there a way to have the code look at a column range and find the number? Instead of having to add each snippet of elseif for each number possibility..
Thanks IA,
cherkey

Re: Better way to search thru cells?

Posted: Fri Sep 19, 2008 4:54 pm
by cherkey
Oh wait...I just found this...would this work?
cherkey

Sub SearchARange
REM Author: Andrew Pitonyak
Dim oSheet
Dim oRange
Dim oFoundCell
oSheet = ThisComponent.getSheets().getByIndex(0)
oRange = oSheet.getCellRangeByName("F7:H11")
oFoundCell = SimpleSheetSearch("41", oRange, False)
End Sub

Re: Better way to search thru cells?

Posted: Fri Oct 17, 2008 9:36 am
by frozbie
Looks like you answered your own question.

Do you have the function code Andrew wrote? Find it at:

http://www.pitonyak.org/oo.php

Mark