LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Scattered array cells copy to scattered array cells another workbook

The code works fine copying to the resized Range M2 in the target workbook.

wksTarget.Range("M2").Resize(columnsize:=myRng.Cel ls.Count) = myArr


I want his array from wksSource

Set myRng = Range("A2,A4,R20,C10,N2,O4,F8,H12,G14")

To workbook "Copy of long.xlsm"

wksTarget.Columns.[8, 6, 4, 5, 3, 7, 2 ,10, 3].End(xlUp)(2) = myArr
(translated to workable code of course)

Thanks.
Howard


Sub AbookToLong()
Dim myRng As Range, MyRng1 As Range
Dim rngC As Range
Dim i As Long
Dim myArr() As Variant

Dim wksSource As Worksheet, wksTarget As Worksheet
Dim wkbSource As Workbook, wkbTarget As Workbook
Dim rngSource As Range, rngTarget As Range

Set myRng = Range("A2,A4,R20,C10,N2,O4,F8,H12,G14")

Set wkbSource = Workbooks("Array cells to another workbook.xlsm")
Set wkbTarget = Workbooks("Copy of long.xlsm")
Set wksSource = wkbSource.Sheets("Sheet1")
Set wksTarget = wkbTarget.Sheets("Sheet1")

Application.ScreenUpdating = False

For Each rngC In myRng
ReDim Preserve myArr(myRng.Cells.Count - 1)
myArr(i) = rngC
i = i + 1
Next

With wksSource
'wksTarget.Range("M2").Resize(columnsize:=myRng.Ce lls.Count) = myArr
wksTarget.Columns.[8, 6, 4, 5, 3, 7, 2 ,10, 3] = myArr
End With

'wksSource.Range("C7:C18").Copy
' wksTarget.Range("X2").PasteSpecial Transpose:=True
'wksSource.Range("C33:C50").Copy
' wksTarget.Range("AJ2").PasteSpecial Transpose:=True

Application.ScreenUpdating = False
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying cells from on row in one wkbk to scattered cells in anthr Memphis Excel Programming 1 February 10th 09 03:22 AM
Best way to total scattered data? Angyl Excel Discussion (Misc queries) 5 October 30th 07 06:38 PM
How do I sum scattered entries on an Excel worksheet? bassmanfranc Excel Worksheet Functions 5 January 20th 06 01:57 PM
Checking for Empty Scattered Cells Kevin O'Neill[_2_] Excel Programming 2 January 4th 06 06:41 PM
Labelling at xy scattered chart kl Charts and Charting in Excel 1 December 18th 05 05:32 PM


All times are GMT +1. The time now is 03:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"