Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel VBA Need to rotate players - find / copy last 3 rows and move to the top

Thanks for helping - Excel 2002
Overview: Need to find the last 3 rows of a range and move them to the top
of the range
1: I need to look for the Last cell of value (Player's name) in a row in Col
C starting at C1012
2: Select the values in that row C D E F as well as the 2 rows above (3 in
all)
3. Block select and move them to the top of new range (Players in same order)
4: Move the rest of the original range below those 3 rows

Your help is appreciated and I promoise to help others
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel VBA Need to rotate players - find / copy last 3 rows and move to the top

Sub AA()
Dim rng As Range
Set rng = Cells(1012, "C").End(xlUp).Offset(-2, 0).Resize(3, 4)
rng.Cut
Range("C1:F1").Insert Shift:=xlShiftDown

End Sub


--
Regards,
Tom Ogilvy



"sam s via OfficeKB.com" wrote in message
...
Thanks for helping - Excel 2002
Overview: Need to find the last 3 rows of a range and move them to the

top
of the range
1: I need to look for the Last cell of value (Player's name) in a row in

Col
C starting at C1012
2: Select the values in that row C D E F as well as the 2 rows above (3 in
all)
3. Block select and move them to the top of new range (Players in same

order)
4: Move the rest of the original range below those 3 rows

Your help is appreciated and I promoise to help others



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel VBA Need to rotate players - find / copy last 3 rows and move to the top

Thank you Tom for your quick response. I just got back and looking forward
to trying your solution.


--
Message posted via http://www.officekb.com
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel VBA Need to rotate players - find / copy last 3 rows and move to the top

Thank you tom - You are a genius- I can't believe how such a small piece of
code did EXACTLY what I needed. Thanks again!!

sam s wrote:
Thank you Tom for your quick response. I just got back and looking forward
to trying your solution.



--
Message posted via http://www.officekb.com
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel VBA Need to rotate players - find / copy last 3 rows and move to the top

One problem I found several hours later. If I hide the rows below 2000 to
end and run the macro. It takes over a minute whereas unhidden takes 3
seconds. I believe it is the shift:=xlshiftdown:. Is there a substitue if I
only need to shift down 200 rows. Thanks

sam s wrote:
Thank you tom - You are a genius- I can't believe how such a small piece of
code did EXACTLY what I needed. Thanks again!!

Thank you Tom for your quick response. I just got back and looking forward
to trying your solution.



--
Message posted via http://www.officekb.com


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 do we copy all the find cells with their rows in the excel? Siddu Excel Discussion (Misc queries) 1 January 18th 08 09:10 AM
Find text and copy and move row containing it gjpcoach Excel Discussion (Misc queries) 5 February 24th 06 08:32 PM
Excel find text and copy rows Denys-mark Excel Discussion (Misc queries) 2 July 25th 05 11:57 AM
Copy rows and move on bg Excel Programming 4 July 11th 05 02:17 AM
How I do I rotate text in an excel cell? The rotate commands is g. MickG Excel Discussion (Misc queries) 3 December 13th 04 08:14 PM


All times are GMT +1. The time now is 11:28 AM.

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"