View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Copy/Paste Worksheet to last and rename with input box for value.

Maybe something like this will get you started:

Option Explicit
Sub testme()

With ActiveWorkbook
.Worksheets("sheet1").Copy _
after:=.Sheets(.Sheets.Count)
On Error Resume Next
Do
ActiveSheet.Name = InputBox(Prompt:="What name?")
If Err.Number < 0 Then
MsgBox "Can't use that name" & vbLf & "try again"
Err.Clear
Else
Exit Do
End If
Loop
On Error GoTo 0
End With

End Sub

(I copied sheet1

Josh wrote:

How can I copy/paste a worksheet into it's current workbook as the last sheet
and rename it with a pop-up input box requesting the name of the new
worksheet.


--

Dave Peterson