#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default 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



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default 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





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default 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




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default 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




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How stop Excel file UK date order changing to US order in m.merge Roger Aldridge Excel Discussion (Misc queries) 1 October 9th 07 11:52 PM
Order of Cell Advancement MRR Excel Worksheet Functions 1 January 18th 07 03:41 PM
alphabetical order within a cell David New Users to Excel 5 June 26th 06 04:33 PM
I want a purchase order that includes page number (if to be order. Angela New Users to Excel 1 December 3rd 04 04:39 PM
Daily Macro to Download Data, Order and paste in order Iarla Excel Worksheet Functions 1 November 17th 04 01:59 PM


All times are GMT +1. The time now is 10:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"