Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro or scripting help
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro or scripting help
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro or scripting help
thanks!! that did the trick..
"Jef Gorbach" wrote in message ... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
security constraints when you a excel scripting macro? | Excel Programming | |||
VBA scripting | Excel Discussion (Misc queries) | |||
Is scripting the way to go here? | Excel Programming | |||
VB Scripting/Macro - Filling/Editing Worksheet References | New Users to Excel | |||
5.6 Scripting | Excel Programming |