#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Worksheets (2003)

Hello,

I have 50+ worksheets with different names and data that needs to be
converted into one worksheet, so that I can have one data source when I merge
the data in publisher. However, I need some assistance with how and were to
place the 50+ worksheet names in the excel spreadsheet. I have include a
sample fields in the worksheets.

Fname, LName, Address etc.

the 1st worksheet name is Region1, then the 2nd is Region 2 etc.
--
Thanks,

Mike
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Worksheets (2003)

Do all the worksheets have the same layout, so it is just a matter of
appending it all?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

" wrote in message
...
Hello,

I have 50+ worksheets with different names and data that needs to be
converted into one worksheet, so that I can have one data source when I
merge
the data in publisher. However, I need some assistance with how and were
to
place the 50+ worksheet names in the excel spreadsheet. I have include a
sample fields in the worksheets.

Fname, LName, Address etc.

the 1st worksheet name is Region1, then the 2nd is Region 2 etc.
--
Thanks,

Mike



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Worksheets (2003)

Hi Mike

Assuming all your sheets have the same number of columns (unspecified by
you), then create a sheet called Summary.
Set the column headings the same as your other sheets.
The following code assumes that Column J is where you want the sheet name to
appear (i.e. you data data in columns A through I)
Change the value for col to whatever is appropriate for you.

Sub copydata()
Dim wsd As Worksheet, ws As Worksheet
Dim lrd As Long, lrs As Long, i As Long
Dim source As Range, dest As Range, col As String

Application.ScreenUpdating = False
' change to suit which column you want sheetname to appear
col = "J" '<====

Set wsd = ThisWorkbook.Sheets("Summary")

For Each ws In ThisWorkbook.Worksheets
If ws.Name < "Summary" Then
ws.Activate
lrs = ws.Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To lrs
ws.Cells(i, "J") = ws.Name
Next i
Set source = ws.Range(Cells(2, "A"), Cells(lrs, col))
lrd = wsd.Cells(Rows.Count, "A").End(xlUp).Row + 1
wsd.Activate
Set dest = wsd.Range(Cells(lrd, "A"), Cells(lrd, col))
source.Copy dest
End If

Next
Sheets("Summary").Activate

Application.ScreenUpdating = True

End Sub

To use
Press F11 to invoke the VB Editor
InsertModule
Copy the code above and paste into white pane that appears.
Alt+F11 to return to Excel
Alt+F8 to bring up the macro dialogueshighlight CopydataRun

--
Regards
Roger Govier

" wrote in message
...
Hello,

I have 50+ worksheets with different names and data that needs to be
converted into one worksheet, so that I can have one data source when I
merge
the data in publisher. However, I need some assistance with how and were
to
place the 50+ worksheet names in the excel spreadsheet. I have include a
sample fields in the worksheets.

Fname, LName, Address etc.

the 1st worksheet name is Region1, then the 2nd is Region 2 etc.
--
Thanks,

Mike


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Worksheets (2003)

Yes, all the layout is the same.

--
Mike

"Bob Phillips" wrote:

Do all the worksheets have the same layout, so it is just a matter of
appending it all?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

" wrote in message
...
Hello,

I have 50+ worksheets with different names and data that needs to be
converted into one worksheet, so that I can have one data source when I
merge
the data in publisher. However, I need some assistance with how and were
to
place the 50+ worksheet names in the excel spreadsheet. I have include a
sample fields in the worksheets.

Fname, LName, Address etc.

the 1st worksheet name is Region1, then the 2nd is Region 2 etc.
--
Thanks,

Mike




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
How do I combine two worksheets in EXCEL 2003 Robert Judge Excel Discussion (Misc queries) 4 February 7th 08 01:48 PM
Excel 2003 Worksheets Bowtie63 Excel Discussion (Misc queries) 2 October 3rd 07 03:24 PM
saving worksheets - Office 2003 Jackie D Excel Discussion (Misc queries) 3 November 20th 05 05:44 PM
Many worksheets; Same formatting - Excel 2003 windsong Excel Discussion (Misc queries) 2 October 26th 05 03:16 PM


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