ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy worksheet (https://www.excelbanter.com/excel-programming/349583-copy-worksheet.html)

owl527[_15_]

copy worksheet
 

Hi,
if I have some data in an excel spreadsheet and I want to copy certain
fields to another excel file. What function can I use? or how should I
go about doing it? Please let me know. Thanks.


--
owl527
------------------------------------------------------------------------
owl527's Profile: http://www.excelforum.com/member.php...o&userid=20916
View this thread: http://www.excelforum.com/showthread...hreadid=498263


evgny[_2_]

copy worksheet
 
Hi owl527
try this, make nessesery changes.
Sub Makro1()
Dim kolA As Double
' detect the last row, you can change "A"
kolA = Cells(Rows.Count, "A").End(xlUp).Row
Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"C:\Your new workbook.xls"
Workbooks("Your orignal").Activate
Workbooks("Your orignal").Worksheets("from sheet").Range("A1:c" &
kolA).Copy _
Destination:=Workbooks("new
workbook").Worksheets("sheet").Range("a1")

Application.ScreenUpdating = True


End Sub
regards
Yngve



All times are GMT +1. The time now is 11:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com