Rename new worksheet

Thehunk71

New Member
Joined
Apr 1, 2006
Messages
35
Office Version
  1. 365
I have searched the board and i can find almost what i am looking for but not quite.
I have a bit of code that creates a new worksheet.

Dim newsheet As Worksheet

Set wks = Worksheets.Add(after:=Worksheets(Worksheets.Count - 5))

With wks
End With

I need to name the new worksheet the value that is in cell a1 on a sheet called "customer data"

Thanks for you help!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Any time after your Set statement, use this line of code to name the sheet...

Code:
wks.Name = Worksheets("customer data").Range("A1").Value
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,981
Members
449,058
Latest member
oculus

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