ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how can I paste 10 cells but inverting the position of the cells (https://www.excelbanter.com/excel-discussion-misc-queries/93539-how-can-i-paste-10-cells-but-inverting-position-cells.html)

Copy and Paste

how can I paste 10 cells but inverting the position of the cells
 
I'd like to copy 10 cells and paste them inverted, last cell first and first
cell last, not transpose, but vertically. Like fliping the 10 cells.

mattgoof2005

how can I paste 10 cells but inverting the position of the cells
 
If you're planning to do this multiple times and it will always be 10 cells,
you could record a macro for it.

"Copy and Paste" wrote:

I'd like to copy 10 cells and paste them inverted, last cell first and first
cell last, not transpose, but vertically. Like fliping the 10 cells.


Copy and Paste

how can I paste 10 cells but inverting the position of the cel
 
Sometimes it will be more than ten. Is there a way to do this without using
macros?

"mattgoof2005" wrote:

If you're planning to do this multiple times and it will always be 10 cells,
you could record a macro for it.

"Copy and Paste" wrote:

I'd like to copy 10 cells and paste them inverted, last cell first and first
cell last, not transpose, but vertically. Like fliping the 10 cells.


Ken Johnson

how can I paste 10 cells but inverting the position of the cells
 

Copy and Paste wrote:
I'd like to copy 10 cells and paste them inverted, last cell first and first
cell last, not transpose, but vertically. Like fliping the 10 cells.

If you have a nearby spare column with numbers 1 to 10 (or any other
sequence of increasing numbers) down that column in the same rows as
your 10 cells you are wanting to copy then invert, you could invert
them before copying, then paste the inverted copy. To invert before
copy just select a range of cells includes your 10 cells for inversion
and the cells with increasing numbers, then sort by the increasing
numbers column in decreasing order. Then do the copy/paste, then resort
ascending order to restore the original data's order.

Ken Johnson


Dave Peterson

how can I paste 10 cells but inverting the position of the cel
 
A macro might be the simplest way.

If you want to try:

Option Explicit
Sub testme03()
Dim FromRng As Range
Dim DestCell As Range
Dim iRow As Long
Dim TotalCells As Long

Set FromRng = Nothing
On Error Resume Next
Set FromRng = Application.InputBox _
(Prompt:="Select a single column range", Type:=8) _
.Areas(1).Columns(1)
On Error GoTo 0

If FromRng Is Nothing Then
Exit Sub
End If

Set DestCell = Nothing
On Error Resume Next
Set DestCell = Application.InputBox _
(Prompt:="Select a single cell", Type:=8).Cells(1)
On Error GoTo 0

TotalCells = FromRng.Cells.Count
For iRow = 1 To TotalCells
DestCell.Offset(iRow - 1, 0).Value _
= FromRng.Cells(TotalCells + 1 - iRow).Value
Next iRow

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm



Copy and Paste wrote:

Sometimes it will be more than ten. Is there a way to do this without using
macros?

"mattgoof2005" wrote:

If you're planning to do this multiple times and it will always be 10 cells,
you could record a macro for it.

"Copy and Paste" wrote:

I'd like to copy 10 cells and paste them inverted, last cell first and first
cell last, not transpose, but vertically. Like fliping the 10 cells.


--

Dave Peterson

Copy and Paste

how can I paste 10 cells but inverting the position of the cel
 
Hi Dave,

Thank you very much for your answer and for all your help!

"Dave Peterson" wrote:

A macro might be the simplest way.

If you want to try:

Option Explicit
Sub testme03()
Dim FromRng As Range
Dim DestCell As Range
Dim iRow As Long
Dim TotalCells As Long

Set FromRng = Nothing
On Error Resume Next
Set FromRng = Application.InputBox _
(Prompt:="Select a single column range", Type:=8) _
.Areas(1).Columns(1)
On Error GoTo 0

If FromRng Is Nothing Then
Exit Sub
End If

Set DestCell = Nothing
On Error Resume Next
Set DestCell = Application.InputBox _
(Prompt:="Select a single cell", Type:=8).Cells(1)
On Error GoTo 0

TotalCells = FromRng.Cells.Count
For iRow = 1 To TotalCells
DestCell.Offset(iRow - 1, 0).Value _
= FromRng.Cells(TotalCells + 1 - iRow).Value
Next iRow

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm



Copy and Paste wrote:

Sometimes it will be more than ten. Is there a way to do this without using
macros?

"mattgoof2005" wrote:

If you're planning to do this multiple times and it will always be 10 cells,
you could record a macro for it.

"Copy and Paste" wrote:

I'd like to copy 10 cells and paste them inverted, last cell first and first
cell last, not transpose, but vertically. Like fliping the 10 cells.


--

Dave Peterson


Copy and Paste

how can I paste 10 cells but inverting the position of the cel
 
Hi Ken,

That is a very simple and brilliant idea. I can't believe I didn't think of
it before.
Thank you very much!

"Ken Johnson" wrote:


Copy and Paste wrote:
I'd like to copy 10 cells and paste them inverted, last cell first and first
cell last, not transpose, but vertically. Like fliping the 10 cells.

If you have a nearby spare column with numbers 1 to 10 (or any other
sequence of increasing numbers) down that column in the same rows as
your 10 cells you are wanting to copy then invert, you could invert
them before copying, then paste the inverted copy. To invert before
copy just select a range of cells includes your 10 cells for inversion
and the cells with increasing numbers, then sort by the increasing
numbers column in decreasing order. Then do the copy/paste, then resort
ascending order to restore the original data's order.

Ken Johnson



Ken Johnson

how can I paste 10 cells but inverting the position of the cel
 
Hi Copy and Paste,

Thanks for those kind words.
I'll pass them on to my superiors:-)

Ken Johnson



All times are GMT +1. The time now is 02:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com