View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default copy row 2 of any wsheet to the new crated wsheet

Sub addsheet()
Set oldsheet = ActiveSheet
On Error GoTo oops
MyValue = InputBox("Enter a name", "Add New Sheet Input Box")
Worksheets.Add.Name = MyValue
oldsheet.Rows("2:2").Copy Destination:=ActiveSheet.Range("A2")
Exit Sub
oops:
MsgBox "Sheet name already exists. Try again"
End Sub


Gord

On Fri, 19 Dec 2008 18:42:04 -0800, celio3c
wrote:

Thanks Socko and Gord

it did worked, perhaps i need a litle more to cover the situation, what if
the name entered already exist, i'm getting a error on that.