View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Macro to insert and name a new worksheet

Try this Price

Sub test()
With ThisWorkbook
If .Worksheets.Count 2 Then
.Worksheets.Add Befo=.Worksheets(.Worksheets.Count - 2)
.ActiveSheet.Name = .Worksheets("Sheet1").Range("a1")
End If
End With
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Price" wrote in message om...
I need a macro to insert a new sheet in the n-3 position where n is
the total number of worksheets. And I need to name the sheet the
name that is in column A of the current row. Example: A1 has Product
A then I hit a button in column G1 and it creates a page called
Product A Plan in the n-3 location.

Your help is appreciated.