View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_2_] Alan Beban[_2_] is offline
external usenet poster
 
Posts: 783
Default Specifying a range within an array

k = 0
For i = 1 To 1: For j = 1 To 14
If HoursArray(i, j) 0 Then k = k + 1
Next: Next
RowHourCellsFound = k

Or, assuming that the functions in the freely downloadable file at
http://home.pacbell.net/beban are available to your workbook

RowHourCellsFound = ArrayCountIf(SubArray(HoursArray,1,14,1,1),0,"")

Alan Beban

Bob wrote:
Can someone kindly tell me how to specify a range within a 2-dimensional
array (e.g., row 1, column 1 through row 1, column 14)? I'm trying to do so
in the following VBA line:

RowHourCellsFound = WorksheetFunction.CountIf(Range(HoursArray(1, 1) & _
":" & HoursArray(1, 14)), "0")

Thanks in advance for any help.