View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kurt Krueger Kurt Krueger is offline
external usenet poster
 
Posts: 1
Default Assigning range names to arrays

Hi,

I want to set an array (array_transit) to any one of a number of
ranges in a workbook. I thought that I could store the range names in
an array and then call the array element number in a set range
statement. Didn't work--any suggestions?

Thanks,

Kurt

Function macro_test(parm_range_id_number As Integer) As Variant
Dim array_transit As Range
Dim array_names
array_names(1) = "range_males_all"
array_names(2) = "range_females_all"
.....
array_names(n) = " ... "

array_transit = Range(array_names(parm_range_id_number))

.. . .

End Function