Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Creating a list from 2 or 3 different worksheets

I have several worksheets that I have contact info in. I like to keep the
worksheets seperate (my own pet peeve- I know it would probaly be easier to
combine them all into one sheet....)
I would like to create a self updating "Mastersheet" that pulls all of the
info from the other worksheet into this one. How would I "step" (step is
probably not the best word, but....) column1 , on each sheet, then copy that
info into the mastersheet, column1.
I was thinking for a nested IF, comparing the row() to the COUNTA of each
sheet, but is there a cleaner, or simpler way?

Thanks

Bruce


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Creating a list from 2 or 3 different worksheets

Dim i as Long
Dim sh as Worksheet
Dim rng as Range
for i = 1 to 3
set sh = worksheets("Sheet" & i)
set rng = sh.Range(sh.Cells(1,1),sh.Cells(1,1).End(xldown))
rng.copy destination:=Worksheets("Master") _
.Cells(rows.count,1).End(xlup)(2)
Next

--
Regards,
Tom Ogilvy


"bruce" wrote in message
...
I have several worksheets that I have contact info in. I like to keep the
worksheets seperate (my own pet peeve- I know it would probaly be easier

to
combine them all into one sheet....)
I would like to create a self updating "Mastersheet" that pulls all of the
info from the other worksheet into this one. How would I "step" (step is
probably not the best word, but....) column1 , on each sheet, then copy

that
info into the mastersheet, column1.
I was thinking for a nested IF, comparing the row() to the COUNTA of each
sheet, but is there a cleaner, or simpler way?

Thanks

Bruce




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Creating a list from 2 or 3 different worksheets

Tom,

Thanks for the reply!
I am having a little issue with the code, as it is only filling from SHEET1,
it is not going to sheet2, or 3. ...

I currently have this set up as a macro. Is there a way where it will up
date the master when new data is added to either of the other sheets?, or to
be ran when ever MASTER is selected?
Also, how would I handle it if I have differnt sheet names?

TIA,

Bruce

"Tom Ogilvy" wrote in message
...
Dim i as Long
Dim sh as Worksheet
Dim rng as Range
for i = 1 to 3
set sh = worksheets("Sheet" & i)
set rng = sh.Range(sh.Cells(1,1),sh.Cells(1,1).End(xldown))
rng.copy destination:=Worksheets("Master") _
.Cells(rows.count,1).End(xlup)(2)
Next

--
Regards,
Tom Ogilvy


"bruce" wrote in message
...
I have several worksheets that I have contact info in. I like to keep the
worksheets seperate (my own pet peeve- I know it would probaly be easier

to
combine them all into one sheet....)
I would like to create a self updating "Mastersheet" that pulls all of
the
info from the other worksheet into this one. How would I "step" (step is
probably not the best word, but....) column1 , on each sheet, then copy

that
info into the mastersheet, column1.
I was thinking for a nested IF, comparing the row() to the COUNTA of each
sheet, but is there a cleaner, or simpler way?

Thanks

Bruce






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Creating a list from 2 or 3 different worksheets

Sub AABB()
Dim i As Long
Dim sh As Worksheet
Dim rng As Range
For i = 1 To 3
Set sh = Worksheets("Sheet" & i)
Set rng = sh.Range(sh.Cells(1, 1), sh.Cells(1, 1).End(xlDown))
rng.Copy Destination:=Worksheets("Master") _
.Cells(Rows.Count, 1).End(xlUp)(2)
Next
End Sub

Was tested and does exactly what you describe.

If you have odd sheet names:

Replace the AA, BB, etc with your sheet names.

Sub AABB()
Dim i As Long
Dim sh As Worksheet
Dim rng As Range
vArr = Array("AA","BB","CC")
For i = lbound(varr) to ubound(varr)
Set sh = Worksheets(vArr(i))
Set rng = sh.Range(sh.Cells(1, 1), sh.Cells(1, 1).End(xlDown))
rng.Copy Destination:=Worksheets("Master") _
.Cells(Rows.Count, 1).End(xlUp)(2)
Next
End Sub

--
Regards,
Tom Ogilvy


"bruce" wrote in message
...
Tom,

Thanks for the reply!
I am having a little issue with the code, as it is only filling from

SHEET1,
it is not going to sheet2, or 3. ...

I currently have this set up as a macro. Is there a way where it will up
date the master when new data is added to either of the other sheets?, or

to
be ran when ever MASTER is selected?
Also, how would I handle it if I have differnt sheet names?

TIA,

Bruce

"Tom Ogilvy" wrote in message
...
Dim i as Long
Dim sh as Worksheet
Dim rng as Range
for i = 1 to 3
set sh = worksheets("Sheet" & i)
set rng = sh.Range(sh.Cells(1,1),sh.Cells(1,1).End(xldown))
rng.copy destination:=Worksheets("Master") _
.Cells(rows.count,1).End(xlup)(2)
Next

--
Regards,
Tom Ogilvy


"bruce" wrote in message
...
I have several worksheets that I have contact info in. I like to keep

the
worksheets seperate (my own pet peeve- I know it would probaly be

easier
to
combine them all into one sheet....)
I would like to create a self updating "Mastersheet" that pulls all of
the
info from the other worksheet into this one. How would I "step" (step

is
probably not the best word, but....) column1 , on each sheet, then copy

that
info into the mastersheet, column1.
I was thinking for a nested IF, comparing the row() to the COUNTA of

each
sheet, but is there a cleaner, or simpler way?

Thanks

Bruce








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
Creating a list of info in A1 cell in multiple worksheets bosch711 Excel Discussion (Misc queries) 4 November 18th 09 11:42 PM
creating a list from a few worksheets not including blanks Scott Excel Worksheet Functions 0 April 30th 08 12:43 AM
Creating number of worksheets based on list Sunnyskies Excel Discussion (Misc queries) 0 October 23rd 06 10:11 AM
Creating a List From Worksheets in a WorkBook Carl Excel Worksheet Functions 1 August 30th 06 09:00 PM
Sort Numerically Worksheets via VB when creating a new worksheets John Excel Programming 6 June 1st 04 07:21 AM


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