Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy rows, but exclude blank rows
I have a worksheet with three columns that has over 1000 rows. What I want
to do is copy a specific range to another workbook, but to exclude any rows that might be blank. Thanks Mary |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy rows, but exclude blank rows
assuming no rows have blanks apart from those to delete then
Option Explicit Sub test() CopyRows Selection, Sheet2.Range("B2") End Sub Sub CopyRows(source As Range, target As Range) With target.Resize(source.Rows.Count, source.Columns.Count) .Value = source.Value .SpecialCells(xlCellTypeBlanks).Delete End With End Sub sheet2 is an empty sheet select your range i=on sheet1 and run the code you can easily adapt the test procedure for specific ranges example CopyRows Sheet1.Range("MyData"), Sheet2.Range("B2") "Mary" wrote: I have a worksheet with three columns that has over 1000 rows. What I want to do is copy a specific range to another workbook, but to exclude any rows that might be blank. Thanks Mary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy to filtered blank rows from another spreadsheet | Excel Discussion (Misc queries) | |||
Copy several row headers to rows (blank) below for each header | Excel Discussion (Misc queries) | |||
copy from one sheet to another and skip the blank rows | Excel Discussion (Misc queries) | |||
Copy rows of data (eliminating blank rows) from fixed layout | Excel Discussion (Misc queries) | |||
Sort Macro to Exclude Blank Rows? | Excel Worksheet Functions |