ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   FILL ARRAY ONE ROW AT A TIME (https://www.excelbanter.com/excel-programming/371382-fill-array-one-row-time.html)

[email protected]

FILL ARRAY ONE ROW AT A TIME
 
Hi,

I have to thank the forum in general for your help. I find there are a
lot of very bright people willing to share their knowledge and time and
I'm very appreciative.

I would like to fill 1 row of an array at a time, excluding the 1st
column. Not 1 cell at a time. something like the following:

Sub FillRow()

Dim aArr As Variant

ReDim aArr(1 To 4, 1 To 2)

aArr(1,1) = "VAL11"
aArr(ROW 1 COLUMN 2 TO 4) = array("VAL12", "VAL13", "VAL14")

aArr(2,1) = "VAL21"
aArr(ROW 2 COLUMN 2 TO 4) = array("VAL22", "VAL23", "VAL24")

End Sub

if anyone knows how to fill 1 complete row at a time in this manner
that would help too. The values for the array elements will come from
VBA strings not a worksheet range.

Thanks,

Ian


Alan Beban

FILL ARRAY ONE ROW AT A TIME
 
If the functions in the freely downloadable file at
http://home.pacbell.net/beban are available to your workbook

Sub abtest1()
Dim aArr()
ReDim aArr(1 To 2, 1 To 4)'<---I think this is what you really meant
aArr2 = Array("VAL11", "VAL12", "VAL13", "VAL14")
aArr3 = Array("VAL21", "VAL22", "VAL23", "VAL24")
ReplaceSubArray aArr, aArr2, 1, 1
ReplaceSubArray aArr, aArr3, 2, 1
End Sub

Alan Beban

wrote:
Hi,

I have to thank the forum in general for your help. I find there are a
lot of very bright people willing to share their knowledge and time and
I'm very appreciative.

I would like to fill 1 row of an array at a time, excluding the 1st
column. Not 1 cell at a time. something like the following:

Sub FillRow()

Dim aArr As Variant

ReDim aArr(1 To 4, 1 To 2)

aArr(1,1) = "VAL11"
aArr(ROW 1 COLUMN 2 TO 4) = array("VAL12", "VAL13", "VAL14")

aArr(2,1) = "VAL21"
aArr(ROW 2 COLUMN 2 TO 4) = array("VAL22", "VAL23", "VAL24")

End Sub

if anyone knows how to fill 1 complete row at a time in this manner
that would help too. The values for the array elements will come from
VBA strings not a worksheet range.

Thanks,

Ian


[email protected]

FILL ARRAY ONE ROW AT A TIME
 
Thanks Alan,

You have a lot of interesting functions using arrays on your site.

Regards,

Ian


Alan Beban

FILL ARRAY ONE ROW AT A TIME
 
wrote:
Thanks Alan,

You have a lot of interesting functions using arrays on your site.

Regards,

Ian

Thanks for the feedback.

Alan


All times are GMT +1. The time now is 02:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com