ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   cell order (https://www.excelbanter.com/excel-discussion-misc-queries/183380-cell-order.html)

scott

cell order
 
if i have a list of names in rows a1:a40 and i want to copy that list to
cells b1:b40 BUT i want the new list to be the exact reverse of the first
one. i got the copy and paste down but how do i "reverse" or "invert" the
selection? thanks in advance

Don Guillett

cell order
 
One way
Sub invertlist()
rev = 1
For i = 5 To 1 Step -1
Cells(rev, "k").Value = Cells(i, "J").Value
rev = rev + 1
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"scott" wrote in message
...
if i have a list of names in rows a1:a40 and i want to copy that list to
cells b1:b40 BUT i want the new list to be the exact reverse of the first
one. i got the copy and paste down but how do i "reverse" or "invert"
the
selection? thanks in advance



Gary''s Student

cell order
 
1. copy A1 thru A30 to B1 thru B30
2. In C1 thru C30 enter 1 thru 30
3. sort cols B & C by C descending
--
Gary''s Student - gsnu200778

scott

cell order
 
i'm new to macros and i'm assuming that's what this is. where do my cell
references go

"Don Guillett" wrote:

One way
Sub invertlist()
rev = 1
For i = 5 To 1 Step -1
Cells(rev, "k").Value = Cells(i, "J").Value
rev = rev + 1
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"scott" wrote in message
...
if i have a list of names in rows a1:a40 and i want to copy that list to
cells b1:b40 BUT i want the new list to be the exact reverse of the first
one. i got the copy and paste down but how do i "reverse" or "invert"
the
selection? thanks in advance




scott

cell order
 
and how would i eliminate any blank rows at the bottom of the original list
from appearing at the top of the new list?

"Don Guillett" wrote:

One way
Sub invertlist()
rev = 1
For i = 5 To 1 Step -1
Cells(rev, "k").Value = Cells(i, "J").Value
rev = rev + 1
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"scott" wrote in message
...
if i have a list of names in rows a1:a40 and i want to copy that list to
cells b1:b40 BUT i want the new list to be the exact reverse of the first
one. i got the copy and paste down but how do i "reverse" or "invert"
the
selection? thanks in advance




Don Guillett

cell order
 
I have changed the columns to suit and this will take care of blank cells at
the bottom. Just put in a module and execute the macro. It might be easier,
for you, to just put numbers in a helper column and sort by that column.

Sub invertlist()
rev = 1
For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
Cells(rev, "b").Value = Cells(i, "a").Value
rev = rev + 1
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"scott" wrote in message
...
i'm new to macros and i'm assuming that's what this is. where do my cell
references go

"Don Guillett" wrote:

One way
Sub invertlist()
rev = 1
For i = 5 To 1 Step -1
Cells(rev, "k").Value = Cells(i, "J").Value
rev = rev + 1
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"scott" wrote in message
...
if i have a list of names in rows a1:a40 and i want to copy that list
to
cells b1:b40 BUT i want the new list to be the exact reverse of the
first
one. i got the copy and paste down but how do i "reverse" or "invert"
the
selection? thanks in advance





scott

cell order
 
the helper column sounds easier but that would leave blank cells

"Don Guillett" wrote:

I have changed the columns to suit and this will take care of blank cells at
the bottom. Just put in a module and execute the macro. It might be easier,
for you, to just put numbers in a helper column and sort by that column.

Sub invertlist()
rev = 1
For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
Cells(rev, "b").Value = Cells(i, "a").Value
rev = rev + 1
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"scott" wrote in message
...
i'm new to macros and i'm assuming that's what this is. where do my cell
references go

"Don Guillett" wrote:

One way
Sub invertlist()
rev = 1
For i = 5 To 1 Step -1
Cells(rev, "k").Value = Cells(i, "J").Value
rev = rev + 1
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"scott" wrote in message
...
if i have a list of names in rows a1:a40 and i want to copy that list
to
cells b1:b40 BUT i want the new list to be the exact reverse of the
first
one. i got the copy and paste down but how do i "reverse" or "invert"
the
selection? thanks in advance





Gord Dibben

cell order
 
Don't copy the list of names.

In B1 enter =INDEX($A$1:$A$40,40-(ROW(A1)-1))

Double-click on B1 fill handle to copy down to B40


Gord Dibben MS Excel MVP


On Fri, 11 Apr 2008 07:35:01 -0700, scott
wrote:

if i have a list of names in rows a1:a40 and i want to copy that list to
cells b1:b40 BUT i want the new list to be the exact reverse of the first
one. i got the copy and paste down but how do i "reverse" or "invert" the
selection? thanks in advance




All times are GMT +1. The time now is 10:51 AM.

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