Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Help needed with copying from one worksheet to another

This assumes your dates are in column C of the first sheet in the tab order.
Sub copyData()
Dim rng as Range, cell as Range
Dim cell1 as Range, sh as Worksheet
with worksheets(1)
set rng = .Range(.Cells(2,3),.Cells(rows.count,3).End(xlup))
End with
rng.Interior.ColorIndex = xlNone
for each cell in rng
set sh = Nothing
on error resume Next
set sh = worksheets(cell.Text)
On error goto 0
if not sh is nothing then
set cell1 = sh.Cells(rows.count,3).End(xlup)(2)
cell.EntireRow.copy cell1.EntireRow
else
cell.Interior.ColorIndex = 3
end if
Next
End sub

In the vbe, do Insert=Module

Place the code in that module.

--
Regards,
Tom Ogilvy


"Ricco" 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help needed with copying from one worksheet to another

Hi,
Thanks for your help,

Joel I tried your code but kept getting a error message,

Tom yours does the job great.

Thanks. again.

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
Copying Macro Needed John Calder New Users to Excel 2 November 4th 09 05:19 AM
Help Needed With Copying Formulas [email protected] Excel Worksheet Functions 6 April 11th 08 05:59 AM
Help needed with copying from one worksheet to another [email protected] Excel Programming 1 April 26th 07 11:58 AM
Help Needed copying a worksheet to new workbook Neil Atkinson Excel Programming 2 September 19th 05 03:16 PM
Copying Macro help needed Rescueme[_2_] Excel Programming 0 October 17th 04 07:38 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"