PC Review


Reply
Thread Tools Rate Thread

how to copy a sheet to diferent workbook. no paste

 
 
=?Utf-8?B?YWlkYW4=?=
Guest
Posts: n/a
 
      14th Nov 2006
I want to copy a range from one workbook to a different one without useing
paste
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmltIEphY2tzb24=?=
Guest
Posts: n/a
 
      14th Nov 2006
You can use:
Wbk1.Activate
Sheets("datasource").Activate
Range("A1:B50").Select
ThisWorkbook.ActiveSheet.Range("C" & rnum) = Selection
--
Best wishes,

Jim


"aidan" wrote:

> I want to copy a range from one workbook to a different one without useing
> paste

 
Reply With Quote
 
=?Utf-8?B?YWlkYW4=?=
Guest
Posts: n/a
 
      14th Nov 2006
Tks Jim

It didn't work
The source is a *.cvs read only, probably this is the reason..
I want to get a range from this source and copy it in my specific workbook,
worksheet and range.
Thanks again for your time


"Jim Jackson" wrote:

> You can use:
> Wbk1.Activate
> Sheets("datasource").Activate
> Range("A1:B50").Select
> ThisWorkbook.ActiveSheet.Range("C" & rnum) = Selection
> --
> Best wishes,
>
> Jim
>
>
> "aidan" wrote:
>
> > I want to copy a range from one workbook to a different one without useing
> > paste

 
Reply With Quote
 
=?Utf-8?B?SmltIEphY2tzb24=?=
Guest
Posts: n/a
 
      14th Nov 2006
There is another method which might work.

Sub test()
Workbooks("DataSource.csv").Activate
Sheets("Total").Activate
Range("S1:S9").Copy
Destination:=Workbooks("DataDestination.xls").Sheets("Total").Range("S1:S9")
End Sub

--
Best wishes,

Jim


"aidan" wrote:

> Tks Jim
>
> It didn't work
> The source is a *.cvs read only, probably this is the reason..
> I want to get a range from this source and copy it in my specific workbook,
> worksheet and range.
> Thanks again for your time
>
>
> "Jim Jackson" wrote:
>
> > You can use:
> > Wbk1.Activate
> > Sheets("datasource").Activate
> > Range("A1:B50").Select
> > ThisWorkbook.ActiveSheet.Range("C" & rnum) = Selection
> > --
> > Best wishes,
> >
> > Jim
> >
> >
> > "aidan" wrote:
> >
> > > I want to copy a range from one workbook to a different one without useing
> > > paste

 
Reply With Quote
 
=?Utf-8?B?YWlkYW4=?=
Guest
Posts: n/a
 
      14th Nov 2006
With your help finally I got it rite:

Sub macro1()
' Moving Data Macro'
Workbooks.Open Filename:= "C:\MYLOCATION\Source.csv"
ActiveWindow.Visible = False
Windows("Source.csv").Visible = True
Range("A1:G1500").Copy
(Workbooks("Destination.xls").Sheets("Sheet2").Range("A1:G1500"))
Workbooks("Source.csv").Close SaveChanges:=False
Windows("Destination.xls").Activate
Sheet2.Select
Columns("A:G").EntireColumn.AutoFit
End Sub

My 2003 Excel didnt like me to use := to specify the destination. () after
copy was good enough.

Thanks again Jim

"Jim Jackson" wrote:

> You can use:
> Wbk1.Activate
> Sheets("datasource").Activate
> Range("A1:B50").Select
> ThisWorkbook.ActiveSheet.Range("C" & rnum) = Selection
> --
> Best wishes,
>
> Jim
>
>
> "aidan" wrote:
>
> > I want to copy a range from one workbook to a different one without useing
> > paste

 
Reply With Quote
 
=?Utf-8?B?SmltIEphY2tzb24=?=
Guest
Posts: n/a
 
      14th Nov 2006
Glad I could help.
--
Best wishes,

Jim


"aidan" wrote:

> With your help finally I got it rite:
>
> Sub macro1()
> ' Moving Data Macro'
> Workbooks.Open Filename:= "C:\MYLOCATION\Source.csv"
> ActiveWindow.Visible = False
> Windows("Source.csv").Visible = True
> Range("A1:G1500").Copy
> (Workbooks("Destination.xls").Sheets("Sheet2").Range("A1:G1500"))
> Workbooks("Source.csv").Close SaveChanges:=False
> Windows("Destination.xls").Activate
> Sheet2.Select
> Columns("A:G").EntireColumn.AutoFit
> End Sub
>
> My 2003 Excel didnt like me to use := to specify the destination. () after
> copy was good enough.
>
> Thanks again Jim
>
> "Jim Jackson" wrote:
>
> > You can use:
> > Wbk1.Activate
> > Sheets("datasource").Activate
> > Range("A1:B50").Select
> > ThisWorkbook.ActiveSheet.Range("C" & rnum) = Selection
> > --
> > Best wishes,
> >
> > Jim
> >
> >
> > "aidan" wrote:
> >
> > > I want to copy a range from one workbook to a different one without useing
> > > paste

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
loop through the workbook and paste every sheet it into newly createdworkbook with same sheet name vicky Microsoft Excel Programming 2 9th Nov 2009 06:12 PM
How to enable Copy and Paste when the sheet and workbook is protected Yuvraj Microsoft Excel Misc 1 20th Jul 2009 04:24 PM
Copy Paste a sheet to new workbook =?Utf-8?B?TWFub3M=?= Microsoft Excel Programming 2 6th Aug 2007 03:10 PM
Copy and paste data from one sheet to another in a single workbook =?Utf-8?B?U0lUQ0ZhblRO?= Microsoft Excel Programming 0 10th Jun 2006 01:58 PM
automatic copy and paste from sheet to sheet in a workbook =?Utf-8?B?cmFtc2V5anJhbXNleWo=?= Microsoft Excel Programming 6 11th Dec 2004 12:37 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:51 PM.