Link to home
Start Free TrialLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

Copy Data to external sheet with criteria

Excel vba 2010


I have code that copies data , but bascially all the data.

I need to only select data where "Column H" cells are blank, null or empty.
the amount of rows will always vary from project to project.


current code here:
Set curWks = ActiveSheet
With curWks

Set rngToCopy = .Range("A6:AU65453", .Range("A6").End(xlToRight).End(xlDown))



End With


Thanks
fordraiders
ASKER CERTIFIED SOLUTION
Avatar of Si Ball
Si Ball
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
please see sample attached
excelfilterpaste.xlsm
Here's a special cells approach.

    With curwks
        Set rngToCopy = .Range("H1:H" & .Cells(Rows.Count, 8).End(xlUp).Row).SpecialCells(xlCellTypeBlanks)
    End With

Open in new window

Avatar of Fordraiders

ASKER

techfanatic, Will this copy all rows ?
starting in column a and going to A6:AU65453A6:AU65453

but only taking rows that are blank cells in column H ?
Thanks