add new sheet to workbook and name

vssa

New Member
Joined
Feb 18, 2012
Messages
16
Hi, im trying to add a new sheet to a workbook at the moment im using this

Code:
Dim WS As Worksheet
Set WS = Sheets.Add
which fine but how can i make the new sheet be called "results"

i was using this method bellow but i heard its not best practice

Code:
[FONT=Arial][SIZE=2]Sheets.Add.Name = "results"[/SIZE][/FONT]
cheers
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
The sheet on the far left will always be index 1, so as long as you're not specifying a location to add it, I guess you could use...

Code:
Sub test()
Sheets.Add
Sheets(1).Name = "Results"
End Sub

But I don't see anything wrong with what you had....

Code:
Sheets.Add.Name = "results"
 
Upvote 0

Forum statistics

Threads
1,215,328
Messages
6,124,299
Members
449,149
Latest member
mwdbActuary

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