Saving newly created workbook as cell name to folder

OneTrueTony

New Member
Joined
Dec 9, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I'll start with saying I've never messed with VBA and Macros.

My boss is looking to take a spreadsheet that breaks down the employees by manager, create new workbooks and save them by the managers name.

I've been able to take the managers by filtering and then create the new workbook but I'm getting stuck on auto naming and saving.


(Creates new workbook and opens it up)
Sub test()

Cells.Select
Range("B1").Activate
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveSheet.Name = ActiveSheet.Range("I1")
Range("b1").Select

End Sub

How would I go about editing the macro to then take the new workbook and save it (file name would be in L2)?
 

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
Hy OneTrueTony,

Welcome to the board.

your query looks very much similar to this.
Sample:
filter_using_range_values.xlsm
ABCDEFGHIJKLMNOPQR
1asdsadasdasdsadasdasdsadasdasdasdasdsfManager 1
2123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5fMANAGER 1Manager 2
313131313131313MANAGER 2Manager 3
45555555MANAGER 1Manager 4
5312312312312312312312MANAGER 3
6354354354354354354354MANAGER 2
7354354354354354354354MANAGER 1
8321321321321321321321MANAGER 1
984848484848484MANAGER 3
103213321332133213321332133213MANAGER 1
1158585858585858MANAGER 2
Sheet1

try it and see if it works for you.
 
Upvote 0
Hy OneTrueTony,

Welcome to the board.

your query looks very much similar to this.
Sample:
filter_using_range_values.xlsm
ABCDEFGHIJKLMNOPQR
1asdsadasdasdsadasdasdsadasdasdasdasdsfManager 1
2123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5f123sad5fMANAGER 1Manager 2
313131313131313MANAGER 2Manager 3
45555555MANAGER 1Manager 4
5312312312312312312312MANAGER 3
6354354354354354354354MANAGER 2
7354354354354354354354MANAGER 1
8321321321321321321321MANAGER 1
984848484848484MANAGER 3
103213321332133213321332133213MANAGER 1
1158585858585858MANAGER 2
Sheet1

try it and see if it works for you.
Thank You! I will start working on this.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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