Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Example-
How can I copy date from cells A1:A5 and then paste them in cells B1:B5 sp that the data from cell A5 is pasted in cell B1, A4 in B2, A3 in B3, A2 in B4, A1 in B5? Please help. Thanks. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Don't paste, use a formula.
Enter this in B1 and drag/copy to B5 =INDEX($A$1:$A$5,5-(ROW(A1)-1)) Gord Dibben MS Excel MVP On Sat, 15 Dec 2007 08:52:01 -0800, Tigerxxx wrote: Example- How can I copy date from cells A1:A5 and then paste them in cells B1:B5 sp that the data from cell A5 is pasted in cell B1, A4 in B2, A3 in B3, A2 in B4, A1 in B5? Please help. Thanks. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for the advise Gord.
However I was looking for something simpler that may exist in Excel in lines of paste special. I may have to do this frequently and hence qriting formulas each time would be time consuming. Thanks again. "Gord Dibben" wrote: Don't paste, use a formula. Enter this in B1 and drag/copy to B5 =INDEX($A$1:$A$5,5-(ROW(A1)-1)) Gord Dibben MS Excel MVP On Sat, 15 Dec 2007 08:52:01 -0800, Tigerxxx wrote: Example- How can I copy date from cells A1:A5 and then paste them in cells B1:B5 sp that the data from cell A5 is pasted in cell B1, A4 in B2, A3 in B3, A2 in B4, A1 in B5? Please help. Thanks. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
To invert copy ... Sub InvertCopy() Dim i As Integer Dim j As Integer j = Cells(Cells.Rows.Count, "A").End(xlUp).Row For i = 1 To j Cells(i, 1).Copy Cells(j - i + 1, 2) Next i End Sub HTH |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Carim,
How can I make use of your program code in excel. I am not too familiar with the VB editor. Do I need to program this as a macro? Please advise. Thanks. "Carim" wrote: Hi, To invert copy ... Sub InvertCopy() Dim i As Integer Dim j As Integer j = Cells(Cells.Rows.Count, "A").End(xlUp).Row For i = 1 To j Cells(i, 1).Copy Cells(j - i + 1, 2) Next i End Sub HTH |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Yes, it is a macro ...
But you should use Gord's formula, which is a lot more elegant ... !!! |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Carim.
Is there a way I can use uour code to program a macro? "Carim" wrote: Yes, it is a macro ... But you should use Gord's formula, which is a lot more elegant ... !!! |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How about a macro that asks what should be copied and where it should be pasted?
Option Explicit Sub testme() Dim FromRng As Range Dim ToCell As Range Dim cCtr As Long Set FromRng = Nothing On Error Resume Next Set FromRng = Application.InputBox _ (Prompt:="Select a range with exactly 1 area and 1 column", _ Default:=Selection.Areas(1).Columns(1).Address, _ Type:=8).Areas(1).Columns(1) On Error GoTo 0 If FromRng Is Nothing Then 'user hit cancel MsgBox "Try later" Exit Sub End If Set ToCell = Nothing On Error Resume Next Set ToCell = Application.InputBox _ (Prompt:="Select a the top cell of the range to paste", _ Type:=8).Areas(1).Cells(1) On Error GoTo 0 If ToCell Is Nothing Then MsgBox "Ok, try later" Exit Sub End If For cCtr = FromRng.Cells.Count To 1 Step -1 ToCell.Offset(FromRng.Cells.Count - cCtr, 0).Value _ = FromRng.Cells(cCtr) Next cCtr 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 Tigerxxx wrote: Thanks Carim. Is there a way I can use uour code to program a macro? "Carim" wrote: Yes, it is a macro ... But you should use Gord's formula, which is a lot more elegant ... !!! -- Dave Peterson |
#9
![]() |
|||
|
|||
![]()
To paste data in the opposite direction in Excel:
That's it! Using the Transpose feature is a quick and easy way to paste data in the opposite direction in Excel.
__________________
I am not human. I am an Excel Wizard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Arrow keys moving opposite direction | Excel Discussion (Misc queries) | |||
How I can change the direction of Paste All in MS-Excel (MOST URGE | New Users to Excel | |||
How I can change the direction of Paste All in MS-Excel | Excel Discussion (Misc queries) | |||
Opposite of SUM function is ?? | Excel Discussion (Misc queries) | |||
The opposite of IF function gives #VALUE for value = 0 | Excel Worksheet Functions |