View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
simora simora is offline
external usenet poster
 
Posts: 7
Default Copy and pasting specific sheet data to a master worksheet

Hi James:

Thanks for the code. I'll try to get it to work.

As for the update weekly ; Every week, we'll start a new workbook
derived from the pervious week ( A Template ). I was thinking of a way
to reference a column from the past week, and have it inserted into the
current week so that I can update the balances.

Last weeks' balances need to be transferred to this week so that when
added to the current invoice totals, I can see the new current amount due.

If you can think of an easier way or a more elegant solution , I'm all
ears / (eyes )

Thanks

-----------------------------------------------------





wrote:
Hi,

The code below worked fine on testing, one comment is "Need to change
last column" this is currently set to "L" but you just need to change
it to the column where your data ends.

As for the update weekly I wasn't sure whether you had meant a seperate
workbook or if the data is updated directly. Either way you should be
able to manipulate the code that I wrote for the copytomaster sub to do
the job. Any problems then let me know.

Sub CopyToMaster()

For i = 1 To ThisWorkbook.Worksheets.Count
Sheets(i).Select
If ActiveSheet.Name = "Totals" Then GoTo Nexti
Data1 = Cells(65536, 1).End(xlUp).End(xlUp).End(xlUp).Row
Range("A5:L" & Data1).Copy 'Need to change last column
Sheets("Totals").Select
If i = 1 Then
Data2 = Cells(65536, 1).End(xlUp).Row + 1
Else
Data2 = Cells(65536, 1).End(xlUp).Row + 3
End If
Range("A" & Data2).PasteSpecial xlPasteAll
Nexti:
Next i

End Sub

James