![]() |
Help needed with copying from one worksheet to another
Hi,
I am trying to write a macro to help me sort out some data for some reports I am running,( I have not really used macro's before and so don't really know where to start. Below is a small example of what I am starting with, This covers a period from 01/04/06 - 31/03/07 I have sorted the date column in order and currently I am using a customised date format to display just the month. Name of the business event Event Type Start date Fee ICT May 0.00 ICT May 55.00 Equality and Diversity May 75.00 Dealing With Customers May 75.00 I have the workbook set up to have 13 worksheets - the first on named Full year is where the data is being pulled from, I then have each of the others named April ...........March. And they all Have the same headings in Row 1 What I am trying to do is to copy the data from the 1st sheet into the correct monthly named sheet, - IE if the date says may then I want the whole row copying into the first empty row in the worksheet"May" If anybody can help I would appreciate it, If you need any more information from me please let me know. Thanks in Advance. |
Help needed with copying from one worksheet to another
Sub copymonth() Sheets("Full year").Activate LastrowColC = Cells(Rows.Count, "C").End(xlUp).Row Set ColCRange = Range(Cells(2, "C"), Cells(LastrowColC, "C")) For Each cell In ColCRange mymonth = cell 'get last row of month worksheet Sheets(mymonth).Activate lastrow = Cells(Rows.Count, "A").End(xlUp).Row cell.EntireRow.Copy Destination:=Range("A" & CStr((lastrow + 1))) Next cell End Sub " wrote: Hi, I am trying to write a macro to help me sort out some data for some reports I am running,( I have not really used macro's before and so don't really know where to start. Below is a small example of what I am starting with, This covers a period from 01/04/06 - 31/03/07 I have sorted the date column in order and currently I am using a customised date format to display just the month. Name of the business event Event Type Start date Fee ICT May 0.00 ICT May 55.00 Equality and Diversity May 75.00 Dealing With Customers May 75.00 I have the workbook set up to have 13 worksheets - the first on named Full year is where the data is being pulled from, I then have each of the others named April ...........March. And they all Have the same headings in Row 1 What I am trying to do is to copy the data from the 1st sheet into the correct monthly named sheet, - IE if the date says may then I want the whole row copying into the first empty row in the worksheet"May" If anybody can help I would appreciate it, If you need any more information from me please let me know. Thanks in Advance. |
All times are GMT +1. The time now is 11:28 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com