Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default collecting data from many sheets to one sheet

I have same structure of data (same column headings) in different sheets.
Each sheet name is a cityname.
What is the easiest way to bring all data from all sheets to a single sheet?
In the new sheet I should also add a new column and put city name (sheet
name).
Is there any written macro in the Internet to do this job?
Some people may ask the reason that I want to merge already separeted data,
but I need to have data in a single sheet.
--
Rasoul Khoshravan Azar
Civil Engineer, Osaka, Japan

collecting data from many sheets to one sheet
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default collecting data from many sheets to one sheet


An easy way is to click on Data, Consolidate.


--
raypayette


------------------------------------------------------------------------
raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569
View this thread: http://www.excelforum.com/showthread...hreadid=565914

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default collecting data from many sheets to one sheet

Thanks. I haven't heard or used consolidate command. I checked the help.
sounds good and will help want I want to do. But like other commands, help is
not easy to follow at least for me. Is there any tutor in MVP for this
command?
--
Rasoul Khoshravan Azar
Civil Engineer, Osaka, Japan


"raypayette" wrote:


An easy way is to click on Data, Consolidate.


--
raypayette


------------------------------------------------------------------------
raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569
View this thread: http://www.excelforum.com/showthread...hreadid=565914


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default collecting data from many sheets to one sheet

One more question about following link:
http://www.excelforum.com/showthread...hreadid=565914
I post my question to microsoft ng but it appears in above link as well.
Could you please explain about this procedure?
Is it automatic or is your setting? What is benefit. Generally what do you
call this technique in web?
will be happy to know more about above technique.
--
Rasoul Khoshravan Azar
Civil Engineer, Osaka, Japan


"raypayette" wrote:


An easy way is to click on Data, Consolidate.


--
raypayette


------------------------------------------------------------------------
raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569
View this thread: http://www.excelforum.com/showthread...hreadid=565914


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default collecting data from many sheets to one sheet


As stated:
"These forums are gateways to selected excel related usenet newsgroups.
"
More info:
http://www.newsadmin.com/bit/gatewayfaq.asp


--
raypayette


------------------------------------------------------------------------
raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569
View this thread: http://www.excelforum.com/showthread...hreadid=565914



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default collecting data from many sheets to one sheet

Ron de Bruin has code that will copy data from worksheets onto a master
sheet, and includes an option to insert the sheet name in a column.

http://www.rondebruin.nl/copy2.htm

Khoshravan wrote:
I have same structure of data (same column headings) in different sheets.
Each sheet name is a cityname.
What is the easiest way to bring all data from all sheets to a single sheet?
In the new sheet I should also add a new column and put city name (sheet
name).
Is there any written macro in the Internet to do this job?
Some people may ask the reason that I want to merge already separeted data,
but I need to have data in a single sheet.



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default collecting data from many sheets to one sheet

I am trying to copy a macro with a function from www.rondebruin.nl/copy2.htm
site.
It has explained how to enter the MAcro but not mentioned how/where to
insert the function. how should I do this? sorry for simple question but it
is my first time use function command in excel.
--
Rasoul Khoshravan Azar
Civil Engineer, Osaka, Japan

where/how to insert a function


"Debra Dalgleish" wrote:

Ron de Bruin has code that will copy data from worksheets onto a master
sheet, and includes an option to insert the sheet name in a column.

http://www.rondebruin.nl/copy2.htm

Khoshravan wrote:
I have same structure of data (same column headings) in different sheets.
Each sheet name is a cityname.
What is the easiest way to bring all data from all sheets to a single sheet?
In the new sheet I should also add a new column and put city name (sheet
name).
Is there any written macro in the Internet to do this job?
Some people may ask the reason that I want to merge already separeted data,
but I need to have data in a single sheet.



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default collecting data from many sheets to one sheet

Hi Rasoul

See
http://www.cpearson.com/excel/codemods.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Khoshravan" wrote in message ...
I am trying to copy a macro with a function from www.rondebruin.nl/copy2.htm
site.
It has explained how to enter the MAcro but not mentioned how/where to
insert the function. how should I do this? sorry for simple question but it
is my first time use function command in excel.
--
Rasoul Khoshravan Azar
Civil Engineer, Osaka, Japan

where/how to insert a function


"Debra Dalgleish" wrote:

Ron de Bruin has code that will copy data from worksheets onto a master
sheet, and includes an option to insert the sheet name in a column.

http://www.rondebruin.nl/copy2.htm

Khoshravan wrote:
I have same structure of data (same column headings) in different sheets.
Each sheet name is a cityname.
What is the easiest way to bring all data from all sheets to a single sheet?
In the new sheet I should also add a new column and put city name (sheet
name).
Is there any written macro in the Internet to do this job?
Some people may ask the reason that I want to merge already separeted data,
but I need to have data in a single sheet.



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html




  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default collecting data from many sheets to one sheet

Perhaps Ron will explain in the other thread, where you're working with
him on the same problem. ( Consolidate different worksheets into one
worksheet)

Khoshravan wrote:
I am trying to copy a macro with a function from www.rondebruin.nl/copy2.htm
site.
It has explained how to enter the MAcro but not mentioned how/where to
insert the function. how should I do this? sorry for simple question but it
is my first time use function command in excel.



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default collecting data from many sheets to one sheet

Thank you so much for this post!!!! It just saved my life and about a days
work! :-)

I modified the code to fit my needs, but it will not run. It stops at the
following line:
sh.Range(sh.Rows(2), sh.Rows(shLast)).Copy

Can someone tell me what I did wrong? Here's the modified code:
Sub MergeSheets()
Dim sh As Worksheet
Dim DestSh As Worksheet
Dim Last As Long

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

'Delete the sheet "Master" if it exist
Application.DisplayAlerts = False
On Error Resume Next
ThisWorkbook.Worksheets("Master").Delete
On Error GoTo 0
Application.DisplayAlerts = True

'Add a worksheet with the name "Master"
Set DestSh = ThisWorkbook.Worksheets.Add
DestSh.Name = "Master"

'loop through all worksheets and copy the data to the DestSh
For Each sh In Sheets(Array("Start", "End"))
Last = LastRow(DestSh)
shLast = LastRow(sh)

'This example copies values and formats from A2 onward
sh.Range(sh.Rows(2), sh.Rows(shLast)).Copy
With DestSh.Cells(Last + 1, "A")
.PasteSpecial xlPasteValues, , False, False
.PasteSpecial xlPasteFormats, , False, False
Application.CutCopyMode = False
End With

'This will copy the sheet name in the H column if you want
'DestSh.Cells(Last + 1, "H").Value = sh.Name

Next

Application.Goto DestSh.Cells(1)

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub

Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function

Thanks again!
--
Hile


"Ron de Bruin" wrote:

Hi Rasoul

See
http://www.cpearson.com/excel/codemods.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Khoshravan" wrote in message ...
I am trying to copy a macro with a function from www.rondebruin.nl/copy2.htm
site.
It has explained how to enter the MAcro but not mentioned how/where to
insert the function. how should I do this? sorry for simple question but it
is my first time use function command in excel.
--
Rasoul Khoshravan Azar
Civil Engineer, Osaka, Japan

where/how to insert a function


"Debra Dalgleish" wrote:

Ron de Bruin has code that will copy data from worksheets onto a master
sheet, and includes an option to insert the sheet name in a column.

http://www.rondebruin.nl/copy2.htm

Khoshravan wrote:
I have same structure of data (same column headings) in different sheets.
Each sheet name is a cityname.
What is the easiest way to bring all data from all sheets to a single sheet?
In the new sheet I should also add a new column and put city name (sheet
name).
Is there any written macro in the Internet to do this job?
Some people may ask the reason that I want to merge already separeted data,
but I need to have data in a single sheet.


--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html







  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default collecting data from many sheets to one sheet

Add a dim line to the macro Hile

Dim shLast As Long


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Hile" wrote in message ...
Thank you so much for this post!!!! It just saved my life and about a days
work! :-)

I modified the code to fit my needs, but it will not run. It stops at the
following line:
sh.Range(sh.Rows(2), sh.Rows(shLast)).Copy

Can someone tell me what I did wrong? Here's the modified code:
Sub MergeSheets()
Dim sh As Worksheet
Dim DestSh As Worksheet
Dim Last As Long

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

'Delete the sheet "Master" if it exist
Application.DisplayAlerts = False
On Error Resume Next
ThisWorkbook.Worksheets("Master").Delete
On Error GoTo 0
Application.DisplayAlerts = True

'Add a worksheet with the name "Master"
Set DestSh = ThisWorkbook.Worksheets.Add
DestSh.Name = "Master"

'loop through all worksheets and copy the data to the DestSh
For Each sh In Sheets(Array("Start", "End"))
Last = LastRow(DestSh)
shLast = LastRow(sh)

'This example copies values and formats from A2 onward
sh.Range(sh.Rows(2), sh.Rows(shLast)).Copy
With DestSh.Cells(Last + 1, "A")
.PasteSpecial xlPasteValues, , False, False
.PasteSpecial xlPasteFormats, , False, False
Application.CutCopyMode = False
End With

'This will copy the sheet name in the H column if you want
'DestSh.Cells(Last + 1, "H").Value = sh.Name

Next

Application.Goto DestSh.Cells(1)

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub

Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function

Thanks again!
--
Hile


"Ron de Bruin" wrote:

Hi Rasoul

See
http://www.cpearson.com/excel/codemods.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Khoshravan" wrote in message ...
I am trying to copy a macro with a function from www.rondebruin.nl/copy2.htm
site.
It has explained how to enter the MAcro but not mentioned how/where to
insert the function. how should I do this? sorry for simple question but it
is my first time use function command in excel.
--
Rasoul Khoshravan Azar
Civil Engineer, Osaka, Japan

where/how to insert a function


"Debra Dalgleish" wrote:

Ron de Bruin has code that will copy data from worksheets onto a master
sheet, and includes an option to insert the sheet name in a column.

http://www.rondebruin.nl/copy2.htm

Khoshravan wrote:
I have same structure of data (same column headings) in different sheets.
Each sheet name is a cityname.
What is the easiest way to bring all data from all sheets to a single sheet?
In the new sheet I should also add a new column and put city name (sheet
name).
Is there any written macro in the Internet to do this job?
Some people may ask the reason that I want to merge already separeted data,
but I need to have data in a single sheet.


--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html





  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default collecting data from many sheets to one sheet

Oops click send to fast

If there is no data on one of the sheets the you also have a problem

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Hile" wrote in message ...
Thank you so much for this post!!!! It just saved my life and about a days
work! :-)

I modified the code to fit my needs, but it will not run. It stops at the
following line:
sh.Range(sh.Rows(2), sh.Rows(shLast)).Copy

Can someone tell me what I did wrong? Here's the modified code:
Sub MergeSheets()
Dim sh As Worksheet
Dim DestSh As Worksheet
Dim Last As Long

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

'Delete the sheet "Master" if it exist
Application.DisplayAlerts = False
On Error Resume Next
ThisWorkbook.Worksheets("Master").Delete
On Error GoTo 0
Application.DisplayAlerts = True

'Add a worksheet with the name "Master"
Set DestSh = ThisWorkbook.Worksheets.Add
DestSh.Name = "Master"

'loop through all worksheets and copy the data to the DestSh
For Each sh In Sheets(Array("Start", "End"))
Last = LastRow(DestSh)
shLast = LastRow(sh)

'This example copies values and formats from A2 onward
sh.Range(sh.Rows(2), sh.Rows(shLast)).Copy
With DestSh.Cells(Last + 1, "A")
.PasteSpecial xlPasteValues, , False, False
.PasteSpecial xlPasteFormats, , False, False
Application.CutCopyMode = False
End With

'This will copy the sheet name in the H column if you want
'DestSh.Cells(Last + 1, "H").Value = sh.Name

Next

Application.Goto DestSh.Cells(1)

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub

Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function

Thanks again!
--
Hile


"Ron de Bruin" wrote:

Hi Rasoul

See
http://www.cpearson.com/excel/codemods.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Khoshravan" wrote in message ...
I am trying to copy a macro with a function from www.rondebruin.nl/copy2.htm
site.
It has explained how to enter the MAcro but not mentioned how/where to
insert the function. how should I do this? sorry for simple question but it
is my first time use function command in excel.
--
Rasoul Khoshravan Azar
Civil Engineer, Osaka, Japan

where/how to insert a function


"Debra Dalgleish" wrote:

Ron de Bruin has code that will copy data from worksheets onto a master
sheet, and includes an option to insert the sheet name in a column.

http://www.rondebruin.nl/copy2.htm

Khoshravan wrote:
I have same structure of data (same column headings) in different sheets.
Each sheet name is a cityname.
What is the easiest way to bring all data from all sheets to a single sheet?
In the new sheet I should also add a new column and put city name (sheet
name).
Is there any written macro in the Internet to do this job?
Some people may ask the reason that I want to merge already separeted data,
but I need to have data in a single sheet.


--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html





  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default collecting data from many sheets to one sheet

ahh
that must be the issue, i created a sandwich Start! and End! so that I
wouldn't have to keep updating the range because I want a certain number of
tabs that vary from month to month (Jan!, Feb!, etc.) but those aren't the
only tabs in the workbook so I didn't want to use the one that did ALL tabs.

The start and end tabs I inserted are empty. :-(
Here I thought I was being creative!

Thanks for the clarification.
--
Hile


"Ron de Bruin" wrote:

Oops click send to fast

If there is no data on one of the sheets the you also have a problem

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Hile" wrote in message ...
Thank you so much for this post!!!! It just saved my life and about a days
work! :-)

I modified the code to fit my needs, but it will not run. It stops at the
following line:
sh.Range(sh.Rows(2), sh.Rows(shLast)).Copy

Can someone tell me what I did wrong? Here's the modified code:
Sub MergeSheets()
Dim sh As Worksheet
Dim DestSh As Worksheet
Dim Last As Long

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

'Delete the sheet "Master" if it exist
Application.DisplayAlerts = False
On Error Resume Next
ThisWorkbook.Worksheets("Master").Delete
On Error GoTo 0
Application.DisplayAlerts = True

'Add a worksheet with the name "Master"
Set DestSh = ThisWorkbook.Worksheets.Add
DestSh.Name = "Master"

'loop through all worksheets and copy the data to the DestSh
For Each sh In Sheets(Array("Start", "End"))
Last = LastRow(DestSh)
shLast = LastRow(sh)

'This example copies values and formats from A2 onward
sh.Range(sh.Rows(2), sh.Rows(shLast)).Copy
With DestSh.Cells(Last + 1, "A")
.PasteSpecial xlPasteValues, , False, False
.PasteSpecial xlPasteFormats, , False, False
Application.CutCopyMode = False
End With

'This will copy the sheet name in the H column if you want
'DestSh.Cells(Last + 1, "H").Value = sh.Name

Next

Application.Goto DestSh.Cells(1)

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub

Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function

Thanks again!
--
Hile


"Ron de Bruin" wrote:

Hi Rasoul

See
http://www.cpearson.com/excel/codemods.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Khoshravan" wrote in message ...
I am trying to copy a macro with a function from www.rondebruin.nl/copy2.htm
site.
It has explained how to enter the MAcro but not mentioned how/where to
insert the function. how should I do this? sorry for simple question but it
is my first time use function command in excel.
--
Rasoul Khoshravan Azar
Civil Engineer, Osaka, Japan

where/how to insert a function


"Debra Dalgleish" wrote:

Ron de Bruin has code that will copy data from worksheets onto a master
sheet, and includes an option to insert the sheet name in a column.

http://www.rondebruin.nl/copy2.htm

Khoshravan wrote:
I have same structure of data (same column headings) in different sheets.
Each sheet name is a cityname.
What is the easiest way to bring all data from all sheets to a single sheet?
In the new sheet I should also add a new column and put city name (sheet
name).
Is there any written macro in the Internet to do this job?
Some people may ask the reason that I want to merge already separeted data,
but I need to have data in a single sheet.


--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html






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 data from various sheets into one sheet vik Excel Worksheet Functions 2 April 14th 06 08:17 PM
Match and Sort for two range of data on different worksheets? Tan New Users to Excel 3 March 9th 06 08:55 AM
Sorting Data from 2 sheets, one sheet which is already sorted M. S. Excel Worksheet Functions 0 July 15th 05 06:42 PM
linking multiple sheets to a summary sheet greg g Excel Discussion (Misc queries) 1 December 16th 04 07:43 AM
Help!: lead sheet data needs to fill appropriate subject sheets carebear Excel Worksheet Functions 0 November 17th 04 07:43 PM


All times are GMT +1. The time now is 12:25 PM.

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"