Moving a Newly Created Sheet is faulting with Correct Name

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
846
Hello All,
I am adding a new sheet and moving to correct location with:
VBA Code:
Sheets.Add().Name = "Spray Booth 1 PVT" 
Sheets("Spray Booth 1 PVT").Select
Sheets("Spray Booth 1 PVT").Move After:=Sheets(3)

However, when I use the code below, it consistently Faults, I've checked the spelling and all that is correct, so I'm at a loss why?
Code:
Sheets.Add().Name = "Spray Booth 1 PVT"
Sheets("Spray Booth 1 PVT").Move After:=("Spray Booth 1")

Thanks for the help
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
846
Ooops...nevermind, I see my mistake, did not include Sheets before ("Spray Booth 1")
works now
 

Forum statistics

Threads
1,147,816
Messages
5,743,376
Members
423,790
Latest member
kevinlee_5

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
Top