Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Checking list for contents

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Checking list for contents

Charles,

wow, thats great - thank you very much. That seems to be exactly what I
was looking for.

Have a nice day
Oliver

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
checking a Cells contents Bob Kilmer Excel Programming 2 September 13th 04 06:41 AM
checking a Cells contents Dave Peterson[_3_] Excel Programming 1 September 9th 04 01:04 PM
checking a Cells contents Bob Kilmer Excel Programming 0 September 9th 04 03:02 AM
Checking contents Edgar Thoemmes Excel Programming 4 February 9th 04 02:01 AM
Checking contents Edgar Thoemmes[_2_] Excel Programming 5 February 3rd 04 02:56 PM


All times are GMT +1. The time now is 01:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"