Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy from 1 sheet into another?


Hi, can anyone assist me with the following.
I have 2 files:
\server1\data\cumulative.xls (file 1)

and

\reports\updates\report.xls (file 2)

The data in file 1 looks like this:
A5:X193 which will increase by extra rows when extra data is entered.
And row 5 is the header row.

I would like to automatically copy the data in columns C,D, E,K &,M o
worksheet "data" of \server1\data\cumulative.xls

INTO

B,C,D,E,F of worksheet "report" of \reports\updates\report.xls

The paste would start at row 484 of reports.xls each time as it woul
be a complete refresh of the current data.

Let me know if any of this doesnt make sense, and thanks for anyone
help !!
love, Amy x

--
AmyTaylo
-----------------------------------------------------------------------
AmyTaylor's Profile: http://www.excelforum.com/member.php...fo&userid=2097
View this thread: http://www.excelforum.com/showthread.php?threadid=38930

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default copy from 1 sheet into another?

Hi,

Try this which assumes both workbooks are active (open). Code is in
"Cumulative.xls" but could be in Personal.xls. It assumes input date finishes
in LR of column D ie.e all rows are same length and header row is NOT copied.
Change 6 to 5 if header row required.

Option Explicit


Sub DataToReport()
'
Dim wb As Workbook
Dim rng As Range
Dim lr As Long

Windows("cumulative.xls").Activate
With Worksheets("Data")
lr = .Cells(Rows.Count, "D").End(xlUp).Row
Set rng = .Range("C6:E" & lr)
Set rng = Union(rng, .Range("K6:K" & lr))
Set rng = Union(rng, .Range("M6:M" & lr))
End With

Set wb = Workbooks("Report.xls")
rng.Copy wb.Worksheets("Report").Range("B484")

End Sub

HTH


"AmyTaylor" wrote:


Hi, can anyone assist me with the following.
I have 2 files:
\server1\data\cumulative.xls (file 1)

and

\reports\updates\report.xls (file 2)

The data in file 1 looks like this:
A5:X193 which will increase by extra rows when extra data is entered.
And row 5 is the header row.

I would like to automatically copy the data in columns C,D, E,K &,M of
worksheet "data" of \server1\data\cumulative.xls

INTO

B,C,D,E,F of worksheet "report" of \reports\updates\report.xls

The paste would start at row 484 of reports.xls each time as it would
be a complete refresh of the current data.

Let me know if any of this doesnt make sense, and thanks for anyones
help !!
love, Amy xx


--
AmyTaylor
------------------------------------------------------------------------
AmyTaylor's Profile: http://www.excelforum.com/member.php...o&userid=20970
View this thread: http://www.excelforum.com/showthread...hreadid=389301


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy from 1 sheet into another?


Hi Toppers, thanks for your help, the code works great !!
Thanks again,
lots of love Amy

--
AmyTaylo
-----------------------------------------------------------------------
AmyTaylor's Profile: http://www.excelforum.com/member.php...fo&userid=2097
View this thread: http://www.excelforum.com/showthread.php?threadid=38930

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy from 1 sheet into another?


Hi Everyone, sorry to disturb, but when I run this, I get subscript out
of range, can anyone help please ?!
Thanks
Amy


--
AmyTaylor
------------------------------------------------------------------------
AmyTaylor's Profile: http://www.excelforum.com/member.php...o&userid=20970
View this thread: http://www.excelforum.com/showthread...hreadid=389301

Reply
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
copy rows from one Data sheet to another sheet based on cell conte John McKeon Excel Discussion (Misc queries) 2 May 15th 10 06:49 AM
Auto Copy/autofill Text from sheet to sheet if meets criteria Joyce Excel Discussion (Misc queries) 0 November 20th 08 11:05 PM
'Copy to' Advance Filter depend only on sheet ID not start sheet Sandy Yates Excel Worksheet Functions 0 April 4th 06 03:48 AM
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. RonMc5 Excel Discussion (Misc queries) 9 February 3rd 05 12:51 AM
providing a sheet-copy event or copy CustomProperties Carlos Cortes Excel Programming 2 November 11th 04 08:24 AM


All times are GMT +1. The time now is 05:32 AM.

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"