Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default COMBINE data in several WORKSHEETS with same header row

Hi all,
I am struggling with my VBA code at the moment trying to automate the task
of collecting data from several worksheets and placing it in one worksheet to
form one data Worksheet with all of the information. Every source Worksheet
has the same top header row record names but the number of records/rows in
each source Worksheet varies. Ideally the merged data would also sort into
order according to the content of column A or 1 in R1C1 reference.

Thanks for your time.
Geoff
England
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default COMBINE data in several WORKSHEETS with same header row

The code to select sheets, copy, paste and sort can all be recorded, with the
caveat that you need to determine which rows to copy from each sheet, and
where to paste on the combined sheet. Here's a snippet that will determine
the final non-blank cell in column A of the active worksheet:
Dim LastRow As Long
Range("A65536").Select
Selection.End(xlUp).Select
LastRow = Selection.Row
MsgBox ("Final row of data is " & LastRow)
You can then use the LastRow variable to select the rows to copy (rows("2:"
& lastrow).select) from each separate worksheet and where to paste (range("A"
& lastrow+1).select) to the combined sheet. --Bruce


"Coconuts" wrote:

Hi all,
I am struggling with my VBA code at the moment trying to automate the task
of collecting data from several worksheets and placing it in one worksheet to
form one data Worksheet with all of the information. Every source Worksheet
has the same top header row record names but the number of records/rows in
each source Worksheet varies. Ideally the merged data would also sort into
order according to the content of column A or 1 in R1C1 reference.

Thanks for your time.
Geoff
England

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default COMBINE data in several WORKSHEETS with same header row

Hi Bruce,

thanks for that. I knew the lasts row coding but the rest is a useful step
forward. I will work on it

thanks again
Geoff

"bpeltzer" wrote:

The code to select sheets, copy, paste and sort can all be recorded, with the
caveat that you need to determine which rows to copy from each sheet, and
where to paste on the combined sheet. Here's a snippet that will determine
the final non-blank cell in column A of the active worksheet:
Dim LastRow As Long
Range("A65536").Select
Selection.End(xlUp).Select
LastRow = Selection.Row
MsgBox ("Final row of data is " & LastRow)
You can then use the LastRow variable to select the rows to copy (rows("2:"
& lastrow).select) from each separate worksheet and where to paste (range("A"
& lastrow+1).select) to the combined sheet. --Bruce


"Coconuts" wrote:

Hi all,
I am struggling with my VBA code at the moment trying to automate the task
of collecting data from several worksheets and placing it in one worksheet to
form one data Worksheet with all of the information. Every source Worksheet
has the same top header row record names but the number of records/rows in
each source Worksheet varies. Ideally the merged data would also sort into
order according to the content of column A or 1 in R1C1 reference.

Thanks for your time.
Geoff
England

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
Combine Data from several worksheets JaeJ New Users to Excel 1 January 9th 09 11:14 PM
How do I combine data from 4 worksheets? grndmntjd Excel Worksheet Functions 1 September 6th 06 10:03 PM
Can you combine data from 2 worksheets into 1 chart? BP Charts and Charting in Excel 1 November 11th 05 12:53 AM
Any way besides cut/paste to combine data in many worksheets (sam. Craig Excel Discussion (Misc queries) 1 March 22nd 05 09:09 PM
Combine Data from 2 worksheets Krefty Excel Discussion (Misc queries) 3 January 14th 05 11:40 PM


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