Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro Excel to automatise the copy of data from one worksheet to another sheet

Hi,

I am looking for aid with the following macro:
- excel file with 5 worksheets
- 4 worksheets contain data which has to be automatically copied to the 5th
worksheet each time you run the macro, or each time you press some button

I tried to record a macro this way:
- go to sheet 1, put mouse on first cel, push control+shift+end
- then i do control+c
- i go to sheet 5 (the "total" sheet) and push control+v
-- the problem: how can i make excel understand he has to put the mouse in
the cell after the last cell of the data which i just copied?
-- other problem: does control+shift+end depend on the amount of rows i copy?
i do not want a certain of rows to be copied. the sheets are updated by
someone else, so i don't know how many rows he added or deleted. excel can
therefore not always copy the exact amount of rows i copied recording the
macro....

Please help me out if someone knows how to do this...

Thanks in advance for any suggestions, advice..

Kristien

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Macro Excel to automatise the copy of data from one worksheet to another sheet

something like this should do it. Change "f" to suit your source column

sub (copyshtstototalsht)
for each ws in activeworkbook.worksheets
if ws.name <"Total" then
with ws
slr=.cells(rows.count,"a").end(xlup).row
dlr=sheet("Total").cells(rows.count,"a").end(xlup) .row+1
..range(cells(2,"a"),cells(slr,"f")).copy sheets("Total").cells(dlr,"a")
end with
next ws
end sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Kripistipien" <u45702@uwe wrote in message news:892813445e7ff@uwe...
Hi,

I am looking for aid with the following macro:
- excel file with 5 worksheets
- 4 worksheets contain data which has to be automatically copied to the
5th
worksheet each time you run the macro, or each time you press some button

I tried to record a macro this way:
- go to sheet 1, put mouse on first cel, push control+shift+end
- then i do control+c
- i go to sheet 5 (the "total" sheet) and push control+v
-- the problem: how can i make excel understand he has to put the mouse
in
the cell after the last cell of the data which i just copied?
-- other problem: does control+shift+end depend on the amount of rows i
copy?
i do not want a certain of rows to be copied. the sheets are updated by
someone else, so i don't know how many rows he added or deleted. excel can
therefore not always copy the exact amount of rows i copied recording the
macro....

Please help me out if someone knows how to do this...

Thanks in advance for any suggestions, advice..

Kristien


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 worksheet tab data into one sheet Bob Excel Programming 5 February 16th 08 04:36 AM
Copy worksheet tab data into one sheet Bob Excel Programming 2 February 15th 08 06:54 PM
How do I copy a graph to new worksheet and get data from new sheet? Elmer Smurdley[_2_] Charts and Charting in Excel 4 September 27th 07 07:26 PM
excel macro to copy data to second sheet Stuart Excel Programming 8 March 19th 05 12:23 PM
Converting Lotus 123 macro to Excel - copy/move data to worksheet Bernice[_2_] Excel Programming 7 February 12th 04 03:47 PM


All times are GMT +1. The time now is 08:06 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"