Insert new sheet

H

Horacio

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

reklamo

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
 
H

Horacio

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:
 
R

reklamo

Hi Horacio

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

Regards
reklamo
 
Top