A simple problem.... probably...

G

Guest

Guest
Hi all,

I am doing an A-level piece of coursework in excel and am stuck. I have a button that copies a worksheet, adds a new worksheet, and then into that newly added worksheet it pastes the previously copied data....

So it basically makes a replica of the original sheet.

This is all ok, but i want it to rename the created sheets accordingly...

So that the first copy made is renamed 'standard window 1', then the next time the button is pressed i want it to rename the sheet 'standard window 2'..etc
I dont think this is particularly hard but i havent figuyred it out yet and am getting a bit panicky, the dealine is ever advancing!!!

Please can some one tell me how, i dont mind a bit of VB as i assume this is the only way..

Thanks in advance. If u would rather email me yer comments my address is mhouldey@yahoo.co.uk

Cheers,

Mike Houldey :|

If only...
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try using this code for your command button:

Private Sub CommandButton1_Click()
Dim counter As Integer
counter = Worksheets.Count
Sheets("Sheet1").Copy After:=Sheets(counter)
Sheets("Sheet1 (2)").Name = "standard window " & counter
End Sub

Subsitute "Sheet1" with your first worksheet's name.

I hope this helps.
Kind regards, Al
This message was edited by Al Chara on 2002-03-14 07:37
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,215
Members
448,554
Latest member
Gleisner2

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