Macro or scripting help

  • Thread starter Thread starter dizzl3e
  • Start date Start date
D

dizzl3e

I have a spreadsheet that goes to column P. All cells have data except for
Column M. Half of column M contains data and the rest are empty cells. I
need to copy or move all data rows associated with the cells in column M
that contains data. Normally I would be able to do this by just recording
macros, but data is constantly being added.

Hope I explained this correctly. Any advice is greatly appreciated.
Thanks.
 
The below suggestion uses autofilter to only show those rows where
column(M) is nonblank, then copy all
of the visible rows to your destination. You didn't specify,so I
showed how to page it on sheet2 starting at cell A1.

sub filtercopy()
Cells.AutoFilter Field:=13, Criteria1:="<>"
Cells.SpecialCells(xlCellTypeVisible).Copy _
Destination:=Worksheets("Sheet2").Range("A1")
Application.CutCopyMode = False
Selection.AutoFilter
end sub


Good luck, have fun, and let me know if/how I can be of further
assistance.
 
Back
Top