Combine Dynamic Worksheets Into One Sheet - Excel Help & Excel Macro Help
SEARCH ENTIRE SITE LOADING..

OZGRID Excel Help & Excel Best Practices Forums

Information Helpful? Why Not Donate.

SPECIALS PAGE FOR BARGAINS | BUILD YOUR GOLF SWING | FREE CUSTOM FUNCTIONS ADD-IN


Download Active Data For Excel Demo


Go Back Excel Help & Excel Macro Help > HELP FORUMS > EXCEL HELP
HOME Register Forum Help Calendar Search For Today's Posts Mark Forums Read

Reply

Combine Dynamic Worksheets Into One Sheet

ANSWERS TO SIMILAR QUESTIONS
Combine The Data From Two Sheets Into One In A Dynamic PageCombine Worksheets from different workbook Combine all worksheets into one??



Javascript DHTML Drop Down Menu Powered by dhtml-menu-builder.com

Create Excel dashboards quickly with Plug-N-Play reports.


 
Thread Tools Search this Thread
Old October 25th, 2007
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
mk1103 mk1103 is offline
I agreed to these rules
 
I'm a Spammer:
MS Office Version: 2003 English
Op System: Windows XP
Assumed Experience: Above Average
Join Date: 25th October 2007
English is 1st Language: Yes
Posts: 5 -- Threads: 1
Combine Dynamic Worksheets Into One Sheet

I have two sheets in this sample workbook attached and need to have the data from the Pending sheet and the Completed sheet to be combined into a third sheet in the same workbook. They have the same column headers and need a macro to combine them even as data is continuously added to both sheets as time goes on. I would greatly appreciate your help.
Attached Files. REMINDER! OzGrid accepts no responsibility for ANY adverse effects as a result from downloading attached files. ALWAYS run an up-to-date virus scan and disable macros.
File Type: xls macros.xls (23.0 KB, 131 views)
Print [Post / Thread] Reply With Quote
Old October 25th, 2007
Dave Hawley's Avatar
Dave Hawley Dave Hawley is offline
Administrator
 
I'm a Spammer: NO
MS Office Version: 2007 English
Op System: Windows Vista
Assumed Experience: Above Average
Join Date: 24th January 2003
English is 1st Language: Yes
Location: Australia
Posts: 49,882 -- Threads: 15169
Re: Combine Worksheets Into One Sheet

Create 2 Dynamic named ranges, then use;

VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing is NOT transferred when copy/pasting, but IS if the keyword uses "quotes".
Sub CombineEm() With Sheet3 ' CodeName .UsedRange.Clear Range("DynaRange1").Copy .Range("A1") Range("DynaRange2").Copy .Cells(.Rows.Count, "A").End(xlUp)(2, 1) End With End Sub
Print [Post / Thread] Reply With Quote
Old October 25th, 2007
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
mk1103 mk1103 is offline
I agreed to these rules
 
I'm a Spammer:
MS Office Version: 2003 English
Op System: Windows XP
Assumed Experience: Above Average
Join Date: 25th October 2007
English is 1st Language: Yes
Posts: 5 -- Threads: 1
Re: Combine Dynamic Worksheets Into One Sheet

Sorry I'm new to this. By naming 2 dynamic ranges do you mean insert and define the ranges for both the pending and completed sheets? I did that and then copied the code into sheet 3 but the macro did not work. Any suggestions? Thank you.
Print [Post / Thread] Reply With Quote
Old October 25th, 2007
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
Trebor76 Trebor76 is offline
Established Member
 
I'm a Spammer:
MS Office Version: 2003
Op System: Windows XP
Assumed Experience: Just Above Average
Join Date: 1st December 2006
English is 1st Language: Yes
Posts: 331 -- Threads: 9
Re: Combine Dynamic Worksheets Into One Sheet

Hi there,

Let me know if the following macro does the trick (you'll have to create a tab called "Combined" first though):

VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing is NOT transferred when copy/pasting, but IS if the keyword uses "quotes".
Sub CombineII() Dim lngLastRow As Long lngLastRow = Sheets("Combined"). Range("A65536").End(xlUp).Row If lngLastRow > 1 Then Sheets("Combined").Range("A1:Q" & lngLastRow).ClearContents End If lngLastRow = Sheets("Pending").Range("A65536").End(xlUp).Row Sheets("Pending").Range("A1:Q" & lngLastRow).Copy Sheets("Combined").Range("A1") lngLastRow = Sheets("Completed").Range("A65536").End(xlUp).Row Sheets("Completed").Range("A2:Q" & lngLastRow).Copy Sheets("Combined").Select Range("A65536").End(xlUp).Offset(1, 0).Select ActiveSheet.Paste Application.CutCopyMode = False End Sub

HTH

Robert
Print [Post / Thread] Reply With Quote
Old October 25th, 2007
Dave Hawley's Avatar
Dave Hawley Dave Hawley is offline
Administrator
 
I'm a Spammer: NO
MS Office Version: 2007 English
Op System: Windows Vista
Assumed Experience: Above Average
Join Date: 24th January 2003
English is 1st Language: Yes
Location: Australia
Posts: 49,882 -- Threads: 15169
Re: Combine Dynamic Worksheets Into One Sheet

It works fine and to create a dynamic named range, hover over dynamic. The code does NOT go into a Sheet, it goes into a standard module. That is, insert>Name>Define.
Print [Post / Thread] Reply With Quote
Old October 25th, 2007
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
mk1103 mk1103 is offline
I agreed to these rules
 
I'm a Spammer:
MS Office Version: 2003 English
Op System: Windows XP
Assumed Experience: Above Average
Join Date: 25th October 2007
English is 1st Language: Yes
Posts: 5 -- Threads: 1
Re: Combine Dynamic Worksheets Into One Sheet

I've copied your code into the module attached in this sheet and for some reason nothing happens as I enable the macros...unless there is something else I'm doing wrong...
Attached Files. REMINDER! OzGrid accepts no responsibility for ANY adverse effects as a result from downloading attached files. ALWAYS run an up-to-date virus scan and disable macros.
File Type: xls macrosv3.xls (26.5 KB, 28 views)
Print [Post / Thread] Reply With Quote
Old October 25th, 2007
Dave Hawley's Avatar
Dave Hawley Dave Hawley is offline
Administrator
 
I'm a Spammer: NO
MS Office Version: 2007 English
Op System: Windows Vista
Assumed Experience: Above Average
Join Date: 24th January 2003
English is 1st Language: Yes
Location: Australia
Posts: 49,882 -- Threads: 15169
Re: Combine Dynamic Worksheets Into One Sheet

DynaRange1 defined as;
= OFFSET(Pending!$A$2,0,0, COUNTA(Pending!$A:$A)-1,COUNTA(Pending!$1:$1))

DynaRange1 defined as;
=OFFSET(Completed!$A$2,0,0,COUNTA(Completed!$A:$A)-1,COUNTA(Completed!$1:$1))

Then run;
VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing is NOT transferred when copy/pasting, but IS if the keyword uses "quotes".
Sub CombineEm() With Sheet4 ' CodeName .UsedRange.Clear Range("DynaRange1").Copy .Cells(.Rows.Count, "A").End(xlUp)(2, 1) Range("DynaRange2").Copy .Cells(.Rows.Count, "A").End(xlUp)(2, 1) End With End Sub
Print [Post / Thread] Reply With Quote
Old October 25th, 2007
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
mk1103 mk1103 is offline
I agreed to these rules
 
I'm a Spammer:
MS Office Version: 2003 English
Op System: Windows XP
Assumed Experience: Above Average
Join Date: 25th October 2007
English is 1st Language: Yes
Posts: 5 -- Threads: 1
Re: Combine Dynamic Worksheets Into One Sheet

Sorry I keep getting an error...is there any way that you could attach the spreadsheet that is working properly to the thread? Thank you for your help.
Print [Post / Thread] Reply With Quote
Old October 25th, 2007
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
Trebor76 Trebor76 is offline
Established Member
 
I'm a Spammer:
MS Office Version: 2003
Op System: Windows XP
Assumed Experience: Just Above Average
Join Date: 1st December 2006
English is 1st Language: Yes
Posts: 331 -- Threads: 9
Re: Combine Dynamic Worksheets Into One Sheet

Hi there,

To use my macro you'll either have to change all references to "Combined" to "Master" in the code or name the third tab as "Combined" instead of "Master".

Have a look at the attached which is based on your original example.

HTH

Robert
Attached Files. REMINDER! OzGrid accepts no responsibility for ANY adverse effects as a result from downloading attached files. ALWAYS run an up-to-date virus scan and disable macros.
File Type: xls 4mk1103.xls (34.0 KB, 75 views)
Print [Post / Thread] Reply With Quote
Old October 25th, 2007
Dave Hawley's Avatar
Dave Hawley Dave Hawley is offline
Administrator
 
I'm a Spammer: NO
MS Office Version: 2007 English
Op System: Windows Vista
Assumed Experience: Above Average
Join Date: 24th January 2003
English is 1st Language: Yes
Location: Australia
Posts: 49,882 -- Threads: 15169
Re: Combine Dynamic Worksheets Into One Sheet

See working example.
Attached Files. REMINDER! OzGrid accepts no responsibility for ANY adverse effects as a result from downloading attached files. ALWAYS run an up-to-date virus scan and disable macros.
File Type: xls macrosv3.xls (29.5 KB, 136 views)
Print [Post / Thread] Reply With Quote
Reply Lifetime Upgrade To Ad Free Styles

   « PREVIOUS Import Multiple Text Files To 1 Worksheet || Stop Blinking When ScrollBar Has Focus NEXT »
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +9. The time now is 23:59.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Ozgrid is Not Associated With Microsoft. Ozgrid Retains the Rights to ALL Posts and Threads