LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Is there an easy way to tell if array.column(x) has any contents?

I am cycling through a large array, and pulling a value from each
'row'/order. I then check it against a second array to see if that order type
has further criteria to identify it as a 'good' or 'bad' order; if so, I
check whether it is a good or bad order.

I now realize that I also need to check to see if the second array's
matching 'column' contains any entries at all (in addition to looking for a
matching entry). Based on this code, I added a comment where I need to check
to see if PEExclude.Columns(PELimited) has any values at all.

I'm hoping there is an easy way; uBound doesn't help because it returns the
size of the whole array. Another option would be to just check the first
value of the array to see if it is blank, but that leaves room for human
error, if the workbook users skip the first row for any reason and put data
in a subsequent row.

I welcome any ideas!
Thanks,
Keith


PEIndicator = 0 'default assumption is that there is noproduct-specific info

'Use ALD code to see if there is product-specific information
'Error = no special criteria, so PEIndicator would remain zero
PELimited = Application.Match(AllRecd(i, 20), PEFamily, False)

If Not (IsError(PELimited)) Then
'check to see if this particular purchase is 'good'
PEP = Application.Match(AllRecd(i, 18), PEInclude.Columns(PELimited),
False)
If IsError(PEP) Then
'If it isn't a good one, check to see if it is a bad one
PEN = Application.Match(AllRecd(i, 18),
PEExclude.Columns(PELimited), False)
'Also check to make sure there are 0 bad ones listed
'?? how do I check to see if array contains any values here??
If IsError(PEN) Then
PEIndicator = 3 '*ignore* this product; not in good or bad list
Else
PEIndicator = 2 'bad/undesirable based on SDS item code
End If
Else
PEIndicator = 1 'good item
End If
End If

 
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
Is there an easy way to switch the contents of cells in Excel? Susan Excel Discussion (Misc queries) 4 June 19th 08 09:58 PM
How can I sort contents of one column based on the contents ofanother column? [email protected] Excel Programming 1 February 9th 08 12:29 PM
Is there an easy way to swap the contents of two cells in Excel? N.B. Yond Excel Discussion (Misc queries) 7 September 23rd 06 02:33 PM
How easy is it to loop in VBA based on cell contents? Lee Harris Excel Worksheet Functions 3 November 25th 05 01:21 AM
Easy Array Question... Tom Ogilvy Excel Programming 0 August 19th 04 07:37 PM


All times are GMT +1. The time now is 06:45 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"