PC Review


Reply
Thread Tools Rate Thread

Cut and Paste Macro

 
 
emilydoak@gmail.com
Guest
Posts: n/a
 
      19th May 2009
Hi Everyone,

I have a worksheet where multiple tables are stacked vertically (so,
the worksheet has ~ 500,000 rows). Approximately every 8,000 rows a
new table will begin and the cell in column A will be "cert". (So
cell A1 is "cert", cell A8316 is "cert", cell A16,631 is "cert", etc.)

Each table has between 4 and 25 columns.

I'm hoping to write a macro that will cut the rows beginning with
"cert" and move them to the top of the worksheet and paste them in the
first blank column in row 1. (Basically to correct the problem of
having multiple tables stacked vertically by laying them out
horizontally, then I can delete the duplicate "cert" columns
manually).

Please let me know if you have any suggestions.

Thanks for you help!
Emily
 
Reply With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      19th May 2009
assuming all the columns have the same headings and this is in row 1
already?
last rw = Range("A1000000").End(xlup).Row

for rw = rw to 2 step -1
IF Cells(rw,1)="cert" then
rows(rw).Delete
End If
Next


<(E-Mail Removed)> wrote in message
news:7243e8b3-1859-4d4a-8033-(E-Mail Removed)...
> Hi Everyone,
>
> I have a worksheet where multiple tables are stacked vertically (so,
> the worksheet has ~ 500,000 rows). Approximately every 8,000 rows a
> new table will begin and the cell in column A will be "cert". (So
> cell A1 is "cert", cell A8316 is "cert", cell A16,631 is "cert", etc.)
>
> Each table has between 4 and 25 columns.
>
> I'm hoping to write a macro that will cut the rows beginning with
> "cert" and move them to the top of the worksheet and paste them in the
> first blank column in row 1. (Basically to correct the problem of
> having multiple tables stacked vertically by laying them out
> horizontally, then I can delete the duplicate "cert" columns
> manually).
>
> Please let me know if you have any suggestions.
>
> Thanks for you help!
> Emily


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007 Macro: Paste - Paste Special - Unformatted Text Gary Petersen Microsoft Outlook VBA Programming 9 28th Dec 2009 03:37 PM
RECORDED MACRO PASTE'S DATE DIFFERENTLY TO MANUAL PASTE =?Utf-8?B?UGF1bGRlY2Fu?= Microsoft Excel Worksheet Functions 0 23rd Jun 2005 05:45 PM
Copy and Paste macro needs to paste to a changing cell reference =?Utf-8?B?bG91bG91?= Microsoft Excel Programming 0 24th Feb 2005 10:29 AM
Cut and Paste using Macro gives paste special method error Lourens Pentz Microsoft Excel Programming 2 16th Nov 2004 12:30 AM
Macro to Paste to specific line, and continue to Paste each time on next row not over tomkarakowski Microsoft Excel Programming 1 28th May 2004 06:50 PM


Features
 

Advertising
 

Newsgroups
 


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