Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying all Rows with data to a New worksheet
Now that I know how to scroll thru all of the rows looking for which
one has data. How can I select all the rows and copy them to a new worksheet if there is data in Column A. I need to remove all of the blank rows from my spreadsheet. For some reason even if the cell has no data excel saves it. So when I hit Ctrl-End it doesn't go to the last cell with data but about 3000 rows further. Any Ideas |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying all Rows with data to a New worksheet
Sub vexed()
Dim r As Range Set r = ActiveSheet.UsedRange il = r.Rows.Count + r.Row - 1 Sheets("Sheet1").Select k = 1 For ii = 1 To il If IsEmpty(Cells(ii, 1)) Then Else Cells(ii, 1).EntireRow.Copy Sheets("Sheet2").Cells(k, 1) k = k + 1 End If Next End Sub This will search down column A in Sheet1; if it finds a non-empty cell it will copy the entire row to Sheet2. -- Gary''s Student "VexedFist" wrote: Now that I know how to scroll thru all of the rows looking for which one has data. How can I select all the rows and copy them to a new worksheet if there is data in Column A. I need to remove all of the blank rows from my spreadsheet. For some reason even if the cell has no data excel saves it. So when I hit Ctrl-End it doesn't go to the last cell with data but about 3000 rows further. Any Ideas |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying rows of data into new worksheet but placing data into colu | Excel Discussion (Misc queries) | |||
Copying rows from 2 sheets to a new worksheet based on date criter | Excel Discussion (Misc queries) | |||
Copying data from one worksheet to another from rows to columns | Excel Worksheet Functions | |||
Copying Rows of data | Excel Programming | |||
Problem copying rows to new worksheet | Excel Programming |