View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Die_Another_Day Die_Another_Day is offline
external usenet poster
 
Posts: 644
Default Checking list for contents

Oliver, try dimming a range, then use .Find
Dim r As Range
Dim fRange As Range
Set r = Range("H2:H8")
Set fRange = r.Find(What:="YourText") 'Add other parameters as
neccessary
If fRange Is Nothing Then 'Not Found

if that doesn't work for you try searching for "Scripting.Dictionary"
or check out this post:
http://groups.google.com/group/micro...67bb607702 9e

Charles Chickering

Odido wrote:
Hi,

I want to read a list of string-values out of cells (e.g. H2:H8) in
Excel into a variable (array) of excel-vba. Is there another
possibility to achieve this than reading one value after the other?

Then I want to check with a single code-line if a value is part of the
array and continue execution depending on the result:

if var_test "is part of" var_array then ......

Can anybody tell me how to do this?

Thx for your help
Oliver