Copy Entire Row to new Sheet (1 Viewer)

MrAustin

Registered User.
Local time
Today, 08:58
Joined
Oct 4, 2004
Messages
32
Hi all --

I have a worksheet that needs to be parsed for certain information, so let me just explain how the sheet is setup first.

The sheet is used to analyze performance metrics, which run along the columns, among category groupings that run along Row A. What I have been charged to do is to copy/paste each Row in this worksheet that is at the TOTAL level (Row B details which level it is).

So my fuzzy logic goes such as this:

- Find "TOTAL" among Row B
- Select entire row (actual contents go through Col AA)
- Switch to new worksheet
- Find next blank row in worksheet, and paste clipboard contents

My problem is that I just don't know how to code this in Excel. If anyone here could help me out, or at the very least point me in a direction to do so, that would be great! I know how to find the TOTAL rows, but I don't know how to extract the row number so that I can do a select on the current row to copy it. I am also having trouble finding the next blank row in the destination worksheet.

Thanks everyone!
 

shades

Registered User.
Local time
Today, 08:58
Joined
Mar 25, 2002
Messages
516
Howdy. As a starting point, turn on the "record macro" and go through what you want to have happen. When you are done, then copy the code from VBE and paste here (using the [ code ] tags, then we can help you clean it up, and make it suable for each time you want to use it (i.e. automatically adjust the row where pasted).
________
Ignazio Giunti
 
Last edited:

Pieter

New member
Local time
Today, 15:58
Joined
Dec 21, 2005
Messages
5
copy rows

Remark: I haven't tested but it should be ok


Dim x as integer
x=1
application.screenupdate = false
do
if cells(x,2) = "total" then 'Caps sensitive
cells(x,2).entirerow.copy
sheets(2).select
cells(65000,1).end(xlup).offset(1,0).select
activesheet.paste
sheets(1).select
end if
x=x+1
loop untill cells(x,2) = ""
application.screenupdate = true


Pieter
 

Users who are viewing this thread

Top Bottom