View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Reverse Order of Copy

myRange is always a selection in a single row, such as A1:A4.

Assuming you meant a single column since that what A1:A4 is:

Sub a()
Dim CellCount As Long
Dim Counter As Long
CellCount = Selection.Rows.Count
For Counter = 1 To CellCount
Selection.Cells(Counter).Copy Range("Q8").Offset(CellCount -
Counter)
Next
End Sub

I'd doing a copy/paste because that's what you asked for. That's what you
need if you want cell formats and/or formulas transferred as opposed to just
values, which is the road Bernard was taking.

--
Jim
"Kirk P." wrote in message
...
myRange is always a selection in a single row, such as A1:A4. The reverse
order would be A4:A1.

"Jim Rech" wrote:

in the reverse order


It's impossible to say since you haven't defined 'reverse order'. For
instance if the selection is A1:A4,C3:D3,D3:D5,C11:D11,D14:D16,C20 what
would the reverse order be?

Btw your posted code is a bit more complex that needed. This is all you
need:

Selection.Copy Range("Q8")

--
Jim
"Kirk P." wrote in message
...
I've got this code which works as expected:

Dim myRange As Range
Set myRange = Selection
Range(myRange.Address).Select
Selection.Copy
Range("Q8").Select
ActiveSheet.Paste

What I would like is for the copy beginning at Q8 to be in the reverse
order
from what's in myRange. How would I accomplish this?