Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to copy a selected Range from the Main Database and Paste
it in a different Workbook, I am using Excel 2007 but it doesn't seem to see the workbook that I want to paste it to. Here is the code. Public Sub PrepareLabels() Dim lrow As Range Dim rc As Integer Dim ar As Integer Sheets(1).Activate Set lrow = Sheet1.Range("A" & Rows.Count).End(xlUp) lrow.Activate ar = ActiveCell.row Range(Cells(4, "a"), Cells(ar, "d")).Copy Workbooks.Open Filename:="C:\Documents and Settings\Dennis\My Documents \Excel\Labels.xls" ' Workbooks.Clear ' ActiveSheet.Delete Range("A1").Select ActiveSheet.Paste Range("A2").Select ActiveWorkbook.Save End Sub When the code gets to the line:- Workbooks.Open Filename:="C: \Documents and Settings\Dennis\My Documents\Excel\Labels.xls" it returns an error saying that the file can not be found. The filename and everything is correct and the file does exist in the location pointed to. Can't seem to get around this. Thankis for any suggestions. Dooley |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Make copy of workbook based on selected criteria | Excel Worksheet Functions | |||
How do I edit a selected range then copy the range into an new sheet??? | Excel Programming | |||
copy selected cells to new workbook? | Excel Programming | |||
Nameing a range while still selected from copy | Excel Programming | |||
Copy selected data to new workbook | Excel Programming |