Insert new sheet

  • Thread starter Thread starter Horacio
  • Start date Start date
H

Horacio

Hi!
Is there some code to insert a new sheet with the contents of the
selected cell?
Tank you
Horacio
 
Try following:

Sub InsertSheet()
ActRow = Selection.Row
ActCol = Selection.Column
ActSheetName = ActiveSheet.Name
ActiveWorkbook.Sheets.Add After:=Worksheets(Worksheets.Count)
Cells(ActRow, ActCol).Value = Sheets(ActSheetName).Cells(ActRow,
ActCol).Value
End Sub

Regards
reklamo
 
Sorry
May I´m not have been well explained.
What we seek is a code that do the following:
In sheet 1 wen I select the cell A1 contains "Test", I want the code
insert a new sheet with the name "Test"
Regards
Horacio

reklamo escreveu:
 
Hi Horacio

Try following code:
Sub InsertSheet()
NewSheetName = Selection.Value
ActiveWorkbook.Sheets.Add After:=Worksheets(Worksheets.Count)
ActiveSheet.Name = NewSheetName
End Sub

Regards
reklamo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top