Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
Is there some code to insert a new sheet with the contents of the selected cell? Tank you Horacio |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "Horacio" wrote: Hi! Is there some code to insert a new sheet with the contents of the selected cell? Tank you Horacio |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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: 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 "Horacio" wrote: Hi! Is there some code to insert a new sheet with the contents of the selected cell? Tank you Horacio |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Horacio
Try following code: Sub InsertSheet() NewSheetName = Selection.Value ActiveWorkbook.Sheets.Add After:=Worksheets(Worksheets.Count) ActiveSheet.Name = NewSheetName End Sub Regards reklamo "Horacio" wrote: 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: 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 "Horacio" wrote: Hi! Is there some code to insert a new sheet with the contents of the selected cell? Tank you Horacio |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Reklamo!
Thank you, the code is perfect. 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 "Horacio" wrote: 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: 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 "Horacio" wrote: Hi! Is there some code to insert a new sheet with the contents of the selected cell? Tank you Horacio |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert sheet tab is not functioning and can't add new sheet | Excel Worksheet Functions | |||
Insert New Sheet De-activates Current Sheet VBA Workaround? | Excel Programming | |||
Insert new Worksheet with name, and insert the sheet into itsalphabetical / numerical location | Excel Programming | |||
insert query into excell sheet to update excell sheet and pivot table | Excel Discussion (Misc queries) | |||
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B | Excel Programming |