Create a new worksheet from a sheet

jgalas

Board Regular
Joined
Jul 4, 2011
Messages
111
Office Version
  1. 2013
Platform
  1. Windows
Hi,

I have several sheets in Workbook ("Avalia"), like sheets("CP1"), sheets("CP2"), sheets("CP3"),.... sheets("STC1"), sheets("STC2"), sheets("STC3"),... sheets("CLC1"), sheets("CLC2"),...
all with data.

I have also a form_Export with commandbuttons one for each sheet in Workbook ("Avalia") and a form_Import with same buttons.

What i want:
1- when i push button in form_Export it will be create, in same workpath a woorkbook named like button was hit + name of main workbook. Sample: hit button - STC1 --> name of new workbook - Avalia-STC1.xls
This workbook have only one sheet - named like button hit, in sample STC1 - and exacty the same as sheet ("STC1") in Workboock ("Avalia").

2
- The same append with the form_Import, but now it will select and import to the data in the clone workbook to "Avalia" same Sheet.

I hope I have been clear in explaining
Thanks
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Seems I have figured out how to do it ... thanks

Private Sub CommandButton1_Click()
Dim Nome As String
Nome = "CP1"
Workbooks.Add xlWorksheet
ActiveWorkbook.SaveAs Filename:=Nome
Sheets(1).Name = Nome
End Sub

:)
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,671
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top