Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
My read when Gareth said C7:C9 (instead of C7:T9) are merged cells was that the columns of cells within the contiguous ranges were merged independantly - i.e. C7:C9 are one merged range and D7:D9 another etc. Your interpretation makes more sence for the particular example because the number of areas matches the cells in A4:F4. However, he did indicate that this was only an example, leaving the possibility of there being multiple merged ranges or just multiple cells within contiguous blocks. Therefore, use of Areas would not work. Obviously, what is needed is more insight from Gareth. Thought I'd point out my interpretation before moving on. Regards, Greg "Jim Cone" wrote: Gareth, Yes it does. The following works... '------------------ Sub Test() Dim rngA As Excel.Range Dim lngN As Long Set rngA = Range("T5,C7:T9,T13,C15:T17,T19,C21:T23") For lngN = 1 To rngA.Areas.Count Range("A4")(1, lngN).Value = rngA.Areas(lngN)(1).Value Next Set rngA = Nothing End Sub '----------------------- Jim Cone San Francisco, USA "Gareth" wrote in message ... c7:c9, etc, are merged cells if that makes ant difference........ "Jim Cone" wrote in message ... Gareth, You can't put 10 lbs in a 5 lb bag. There are 165 cells in... Range("T5,C7:T9,T13,C15:T17,T19,C21:T23") and 6 cells in... Range("A4:F4") Your can do this... Sheets("Sheet2").Range("A4:F4").Value = Sheets("Sheet1").Range("G4:L4").Value Regards, Jim Cone San Francisco, USA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
multiple selection copy & paste across multi-worksheets | Excel Discussion (Misc queries) | |||
Help creating a macro to copy and paste a certain selection | Excel Discussion (Misc queries) | |||
Help creating a macro to copy and paste a certain selection | Excel Discussion (Misc queries) | |||
selection.copy - how emulate Paste command? | Excel Discussion (Misc queries) | |||
Copy&Paste and Selection Change | Excel Programming |