Error in this code
Workbooks("original.xls").Worksheets("shee
5").Range("A10:LastRowWithData").Copy
Destination:=Workbooks("new.xls").Worksheets("Shee t1").Range("A1")
should be
Workbooks("original.xls").Worksheets("sheet 5").Range("A10:"
LastRowWithData).Copy
Destination:=Workbooks("new.xls").Worksheets("Shee t1").Range("A1")
Also if you have one column that has an entry in each row then
suggest you use
dim LastRowWithData
LastRowWithData = Range("a65536").End(xlUp).Row
' Create new workbook
Set NewBook = Workbooks.Add
With NewBook
.SaveAs Filename:="new.xls"
End With
Workbooks("original.xls").Worksheets("sheet 5").Range("A10:"
LastRowWithData).Copy
Destination:=Workbooks("new.xls").Worksheets("Shee t1").Range("A1"
-----------------------------------------------
~~ Message posted from
http://www.ExcelTip.com
~~View and post usenet messages directly from
http://www.ExcelForum.com