Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there way to assign one line value in multidimensional array?

Status
Not open for further replies.

Ken

IS-IT--Management
Jul 13, 2005
68
CA
[tt]Hi,
Is it possible to create array of 4 dimension.
Array values in one line, with changing sheet name and range
Question 1: assigning arrays values in one line ?
Question 2: giving value using below worksheet code ?

Code:
.          sheet,  range,   sheet,   range
Arry(1) = "Sht1", "A2:D4", "Sht2", "E5:H7"
Arry(2) = "Sht3", "C5:E6", "Sht4", "c5:e6"
Arry(3) = "Sht5", "B4:d5", "Sht6", "F7:h8"

for i = 1 to 3
    Worksheets(arry(i)).Range(arry(i)).value = _ 
    Worksheets(arry(i)).Range(arry(i)).value
next i
Any way to do it ?
Thanks,

TechIT
[/tt]
 
hi

Code:
  Dim Arry(2,3) as string 
'          sheet,  range,   sheet,   range
Arry(0,0) = "Sht1"
Arry(0,1) = "A2:D4"
Arry(0,2) = "Sht2"
Arry(0,3) = "E5:H7"
Arry(1,0) = "Sht3"
Arry(1,1) = "C5:E6"
Arry(1,2) = "Sht4"
Arry(1,3) = "c5:e6"
Arry(2.0) = "Sht5"
Arry(2.1) = "B4:d5"
Arry(2.2) = "Sht6"
Arry(2.3) = "F7:h8"

for i = 0 to ubound(Arry(1))
    Worksheets(arry(i,0)).Range(arry(i,1)).value = _ 
    Worksheets(arry(i,2)).Range(arry(i,3)).value
next i

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top