View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mick Southam Mick Southam is offline
external usenet poster
 
Posts: 17
Default Paste to Multiple Selections

Bernie

If say, there were 20 or more non adjacent cells in the reference you were
trying to paste to, how would you do it then?

Thanks

Mick

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Mick,

Just do it twice:

Worksheets("DataSheet").Range("G10").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A4").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A4"), xlFillWithContents
Worksheets("DataSheet").Range("G14").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A15").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A15"), xlFillWithContents

HTH,
Bernie
MS Excel MVP

"Mick Southam" wrote in message
...
Bernie

Thanks, unfortunately the ranges used in the example were in correct, in

as
much as they are not adjacent i.e. G10:G11 should read G10,G14 and A4:A5
should read A4,A15. I can get the code to work if I past to adjacent

cells
but not non adjacent cells - Hope that make sense

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Mack,

You should group the sheets after the copy, and use the

FillAcrossSheets
method:

Worksheets("DataSheet").Range("G10:G11").Copy
Sheets(Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", _
"Aug", "Sep", "Oct", "Nov", "Dec")).Select
Range("A4:A5").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.SelectedSheets.FillAcrossSheets _
Range("A4:A5"), xlFillWithContents


HTH,
Bernie
MS Excel MVP

"Mick" wrote in message
...
Hi
I am trying to find a way to be able to paste to multiple
selections in a number of grouped sheets. In the example
below it only refers to 2 cell locations whereas there are
actually more.

Thanks in antisipations.

Mick

Sheets(Array
("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "S
ep", "Oct", "Nov", _
"Dec")).Select
Sheets("Jan").Activate

Worksheets("DataSheet").Range("G10,G11").Copy
ActiveSheet.Paste Destination:=Worksheets("Jan").Range
("A4:A5") 'Selection.Paste
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False