View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Yunus Patel Yunus Patel is offline
external usenet poster
 
Posts: 4
Default Worksheet Names using Macros

On Feb 21, 1:01*am, Gord Dibben wrote:
Add the sheets macro.

Assumes the names are in Sheet1

Sub Add_Sheets()
Dim rCell As Range
Dim Rng As Range
Set Rng = Range(Cells(1), Cells(Rows.Count, 1).End(xlUp))
For Each rCell In Rng
* * With Worksheets.Add(after:=Worksheets(Worksheets.Count) )
* * * * .Name = rCell.Value & "-" & rCell.Offset(0, 1).Value
* * End With
Next rCell
End Sub

Formula to go into D1 on Sheet1

=INDIRECT("'" & A1 &"-"& B1 & "'!U8")

Gord

On Mon, 20 Feb 2012 15:48:52 -0800 (PST), Yunus Patel



wrote:
Hi I have 2 Columns in Worksheet....


A * * *B
201 *NEB
202 *NEB
203 *NEB
204 *NWB
205 *NWB
209 *NWB


Using formula or Macro how would I create and name new Worksheets
named after each Row i.e
201-NEB, 202-NEB 203-NEB, 204-NWB, 205-NWB, 209-NWB. Its simple to do
it manually from the above example, but what if I wanted to create 30
worksheets named after each row in Worksheet 1


Once I created a Worksheet...
Using Macro or Formula, How would I create a new Column in Worksheet
1,
which extracts value from a specific cell from each Worksheet using
the
Columns above.


I attempted using the formula below but with no joy.....
="=""'"&A3&"-"&B3&"'"&"!"&"U8"


This result only returns '='203-NEB'!U8 not the value in Cell U8- Hide quoted text -


- Show quoted text -


Thanks Gord
The Macro only works for an existing list, what if I want to update
or add to that list to rename or create more worksheets