View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Add sheet to end

Worksheets.Add after:=Worksheets(Worksheets.C*ount)


--
Don Guillett
SalesAid Software

"Patti" wrote in message
...
Hello. How do I get this to add the new sheet to the end of my workbook:

Sub CopyRange()

Dim wsMain As Worksheet, wsNew As Worksheet

Set wsMain = Sheets("test")
Set wsNew = Sheets.Add
wsMain.Range("A:B").Copy wsNew.Range("A1")
wsNew.Name = InputBox("Enter New Worksheet Name")

End Sub

Thanks,

Patti