Copy range if column N is empty

R

Rick Rothstein

I'm using XL2003 as well and both of those macros worked on the sample data
I made up. Is there any chance you can send me a copy of your workbook so I
can see what is going on directly (it would be okay for you to replace real
data with fake data, but I'm interested in the values in Column N on both
sheets... in particular, whether they are typed in values or formulas? If
so, set it up so that its in the condition just prior to needing the macros
run. You will need to remove the NO.SPAM stuff from my email address.
 
A

ajm1949

Hi Rick

Have been doing some more research and came up with this modofication of you
first code sample
Sub terranean1()

Intersect(Sheets("Sales").Columns("A:T"), Sheets("Sales"). _

Columns("N").SpecialCells(xlCellTypeBlanks). _
EntireRow).Copy Sheets("Carry
overs").Cells(Rows.Count, 1).End(xlUp)(2)

End Sub

This seems to work and runs quickly. Can you see any problems with this?

Still doing some more homework on the code to clean up the Carry Overs sheet

Thanks again for your help

Cheers

Alan
 
R

Rick Rothstein

As long as no other column will have more rows filled in than Column A, that
should work fine. The code I gave you, which should work, finds the largest
row number no matter what column that row is in and uses that to set the
copy position.
 
A

ajm1949

Thanks Rick
Email is on the way
Alan

Rick Rothstein said:
I'm using XL2003 as well and both of those macros worked on the sample data
I made up. Is there any chance you can send me a copy of your workbook so I
can see what is going on directly (it would be okay for you to replace real
data with fake data, but I'm interested in the values in Column N on both
sheets... in particular, whether they are typed in values or formulas? If
so, set it up so that its in the condition just prior to needing the macros
run. You will need to remove the NO.SPAM stuff from my email address.

--
Rick (MVP - Excel)




.
 
R

Rick Rothstein

I just sent the answer back to you. The problem appears to be in the name of
the carry overs sheet... since you said the name was "Carryovers" (one word)
in your original message, I used that; however, I see on the workbook you
sent me that the sheet is actually named "Carry overs" (two words)... make
that change in my posted code and the code should work fine for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top