Help with Array -> Range assigment

Roopher

Board Regular
Joined
Jul 8, 2008
Messages
73
Hello there!

I am kind of baffled with an array assignment task which should be working as intended, but isn't:

1.
I have an VBA array *asglWriteBack(1 to 139)*, which is correctly filled with singles.

2.
Also, I have a range of the same dimension, which is a column of an listobject table: *mlstCurrentStratTable.ListColumns(14).DataBodyRange*.

3.
What I want to do is to assign the array to the range to have the range (table column) filled; so I try: *mlstCurrentStratTable.ListColumns(14).DataBodyRange = asglWriteBack*.

P.
The problem is, that the entire column (i.e. all of its 139 cells) is not being mapped to the array content, but only filled with the content of the first array element: When the first array element asglWriteBack(1) has the value 'xyz', then the entire range mlstCurrentStratTable.ListColumns(14).DataBodyRange gets assigned 'xyz'. What I am doing wrong here with the mapping?

ps: I don't want to iterate all the range's cells individually; I'd like to 'flash'-in the array onto that range.



Thank's alot for you suggestions!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Try:

Code:
mlstCurrentStratTable.ListColumns(14).DataBodyRange = WorksheetFunction.Transpose(asglWriteBack)
 
Upvote 0
Oh yes, this did the job! Thank you very much for the quick reply, too, Andrew Poulsom. Just wondering why I was not trying the transposition by myself...


By the way, how can I insert a code window into my messages as you have done? Would I need some HTML tags?

Cheers!
 
Upvote 0

Forum statistics

Threads
1,217,349
Messages
6,136,051
Members
449,986
Latest member
rittersportyummy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top