Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default New Worksheet Values Auto Displayed on Sheet 1

I have a WorkBook that has a macro that copies worksheet2, and adds it to
the workbook as worksheet3.
Want i want to do is have on WorkSheet1 display cells B3 & Z48 values of
EACH worksheet in the workbook.
Like:

Tab Name Name Location

Sheet1 Fred Bedrock
Sheet2 Jack BeanStalk
Sheet3 Adam Eden


I tried this with simple formula, but IF the worksheet DID NOT exist yet, i
get an error, because it cannot find the sheet.


Any idea's how i can display these values from each sheet and each new sheet
on Sheet1?

Regards

Corey


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default New Worksheet Values Auto Displayed on Sheet 1

Sorry forgot to add, i will have up to 49 sheets in the book before i start
a new workbook.
So values from sheets 2-49 need to be displayed on sheet1.
Corey....


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default New Worksheet Values Auto Displayed on Sheet 1

Corey,
Something like:
Private Sub Workbook_NewSheet(ByVal Sh As Object)
Dim i As Long

For i = 2 To Worksheets.Count
With Worksheets(1).Range("A1")
.Offset(i, 0).Value = Worksheets(i).Name
.Offset(i, 1).Value = Worksheets(i).Range("B3").Value
.Offset(i, 2).Value = Worksheets(i).Range("Z48").Value
End With
Next
End Sub

NickHK

"Corey" wrote in message
...
I have a WorkBook that has a macro that copies worksheet2, and adds it to
the workbook as worksheet3.
Want i want to do is have on WorkSheet1 display cells B3 & Z48 values of
EACH worksheet in the workbook.
Like:

Tab Name Name Location

Sheet1 Fred Bedrock
Sheet2 Jack BeanStalk
Sheet3 Adam Eden


I tried this with simple formula, but IF the worksheet DID NOT exist yet,

i
get an error, because it cannot find the sheet.


Any idea's how i can display these values from each sheet and each new

sheet
on Sheet1?

Regards

Corey




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default New Worksheet Values Auto Displayed on Sheet 1

Thanks Nick.
Perfect....

CTM


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default New Worksheet Values Auto Displayed on Sheet 1

Corey,
This code assumes that the first worksheet [Worksheets(1)], does not contain
data.
Also that when you add/copy worksheets you specify the location so they do
not appear as Worksheets(1).

NickHK

"Corey" wrote in message
...
Thanks Nick.
Perfect....

CTM




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
Look up in another sheet for values to return in 1st worksheet ralph Excel Discussion (Misc queries) 2 April 12th 10 02:32 PM
Zero(0) values box checked-but not displayed as a 1st digit ? BoyBaby Excel Worksheet Functions 3 December 11th 07 07:34 AM
Comparing displayed values steev_jd Excel Discussion (Misc queries) 2 April 4th 06 04:24 PM
displayed cell values tomoutdoors Excel Worksheet Functions 2 January 13th 05 09:34 PM
Beginner - Excel - Auto look up values from worksheet 3 from User duBedat68 Excel Programming 0 December 20th 04 04:47 AM


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