Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy rows from one Data sheet to another sheet based on cell conte | Excel Discussion (Misc queries) | |||
Auto Copy/autofill Text from sheet to sheet if meets criteria | Excel Discussion (Misc queries) | |||
'Copy to' Advance Filter depend only on sheet ID not start sheet | Excel Worksheet Functions | |||
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. | Excel Discussion (Misc queries) | |||
providing a sheet-copy event or copy CustomProperties | Excel Programming |