Moving a Newly Created Sheet is faulting with Correct Name

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
946
Office Version
  1. 2016
Platform
  1. Windows
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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Ooops...nevermind, I see my mistake, did not include Sheets before ("Spray Booth 1")
works now
 
Upvote 0

Forum statistics

Threads
1,215,052
Messages
6,122,878
Members
449,097
Latest member
dbomb1414

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