How to paste Array into range

Whistler

Board Regular
Joined
Jul 14, 2011
Messages
61
Hi,

I have a range saved in Array called Phase1, I would like to paste this array into cell C4 in Activesheet. The array is a column of 10 cells.

How I can do that using VBA, any help much apreciated

thanks
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
When I use this code:

ws.Range("C4:C16") = WorksheetFunction.Transpose(All)

Only the first element of Array is pasted in to all cells.

Any Idea?
 
Upvote 0
Try without the transpose.

But for more help you have to share some more information...

How is your array declared?

What is All? How does it relate to the Phase1 in your original post?
When I use this code:

ws.Range("C4:C16") = WorksheetFunction.Transpose(All)

Only the first element of Array is pasted in to all cells.

Any Idea?
 
Upvote 0
Thanks for replay tusharam,

I have 4 Arrays declared As:

Code:
Dim All As Variant
Dim Phase1 As Variant
Dim Phase2 As Variant
Dim SP3 As Variant
Set All = ws.Range("B4:B16")
Set Phase1 = ws.Range("B19:B22")
Set Phase2 = ws.Range("B25:B31")
Set SP3 = ws.Range("B33:B35")

All is one of it.
 
Upvote 0
If you use Set X=... then X is not an array but an object that references the range on the RHS.

Depending on what it is you want to do try
Code:
ws.range("destination range").value=phase1.value.
Alternatively, try
Code:
All=Range(...).value
Range(...).value = All
Thanks for replay tusharam,

I have 4 Arrays declared As:

Code:
Dim All As Variant
Dim Phase1 As Variant
Dim Phase2 As Variant
Dim SP3 As Variant
Set All = ws.Range("B4:B16")
Set Phase1 = ws.Range("B19:B22")
Set Phase2 = ws.Range("B25:B31")
Set SP3 = ws.Range("B33:B35")

All is one of it.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

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