Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy entire row to another workbook
I'm trying to copy all rows in a workbook into a seperate workbook
based on a date column, and an entered date range. I want to have this loop so that it will get all rows, but I keep getting errors, or dates that don't fall withing the date range being copied. Here's what i have so far, with the date range being on the DATA sheet in b8 for beginning and b9 for ending, right now it's erroring out on activesheet.paste, any ideas? Sub PullDown() Dim UsedRng As Range Dim LastRow As Long Dim E As Range Dim mySheet As String With Application .CutCopyMode = False .ScreenUpdating = False .DisplayAlerts = False End With mySheet = ActiveSheet.Name Sheets("DATA").Activate BegDate = [B8].Value EndDate = [b9].Value Workbooks("project request.xls").Activate LastRow = Cells(Rows.Count, "b").End(xlUp).Row Set UsedRng = Range("B2:B" & LastRow) For Each E In UsedRng If E.Value = BegDate Then If E.Value <= EndDate Then Range(E, ActiveCell.End(xlToRight)).select Selection.Copy Workbooks("support by project.xls").Activate If ActiveSheet.Name < mySheet Then Sheets(mySheet).Activate Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Paste ActiveSheet.Paste End If Next E End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I copy and paste an entire workbook? | Excel Worksheet Functions | |||
Copy Paste Values - Entire Workbook and Save | Excel Discussion (Misc queries) | |||
how do i copy an entire workbook and paste it in another | New Users to Excel | |||
How do I make a copy of a entire workbook? | Excel Discussion (Misc queries) | |||
Copy page format into an entire workbook | Excel Worksheet Functions |