Thread: TAB STRIP CODE
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Fadi Chalouhi Fadi Chalouhi is offline
external usenet poster
 
Posts: 5
Default TAB STRIP CODE

Hi,

the attached code will insert 3 worksheets to your workbook and rename
them based on the contents of cells A1:A3 of your active sheet. The
code is basic but it should put you in the right direction.

Sub InsertSheets()
'
Dim WsCurrent As Worksheet

Set WsCurrent = ActiveSheet
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = WsCurrent.Range("A1").Value
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = WsCurrent.Range("A2").Value
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = WsCurrent.Range("A3").Value
End Sub

HTH

Fadi
www.chalouhis.com/XLBLOG