LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I copy and paste an entire workbook? Jordon Excel Worksheet Functions 4 April 3rd 23 02:13 PM
Copy Paste Values - Entire Workbook and Save Scott Campbell[_2_] Excel Discussion (Misc queries) 1 August 9th 07 07:53 PM
how do i copy an entire workbook and paste it in another BELINDA New Users to Excel 1 June 11th 07 01:02 PM
How do I make a copy of a entire workbook? Jan B. Excel Discussion (Misc queries) 2 June 1st 06 12:11 AM
Copy page format into an entire workbook mdeanda Excel Worksheet Functions 2 August 3rd 05 08:12 PM


All times are GMT +1. The time now is 12:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"