Macro to make new workbook saved as "Fixed name & cell value"

Antonescu

New Member
Joined
Feb 19, 2021
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi there,

Can anyone please help me with this?
I need a macro to copy a sheet into a new workbook, save it in a certain location and name it as one fixed part & cell value & another fixed part.
Below is what I have so far, basically, I want the bolded A1 in the code to be the value in the A1 cell.

Thanks so much!

Sub Fisier()
'
' Fisier Macro
'

'
Sheets("extract").Select
Sheets("extract").Copy
ChDir "C:\Users\AntonG\Desktop"
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\AntonG\Desktop\Nume A1 Prenume.xlsx", FileFormat:=xlOpenXMLWorkbook _
, CreateBackup:=False
Application.WindowState = xlNormal
End Sub
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,400
"C:\Users\AntonG\Desktop\Nume" & Range("A1").Value & "Prenume.xlsx"
 

Antonescu

New Member
Joined
Feb 19, 2021
Messages
3
Office Version
  1. 365
Platform
  1. Windows
"C:\Users\AntonG\Desktop\Nume" & Range("A1").Value & "Prenume.xlsx"
Worked like a charm.
Thanks a lot, you saved me sooo much time, if not for your solution, I had like 600 files to name by hand.

Have a great weekend :)
 

Watch MrExcel Video

Forum statistics

Threads
1,129,666
Messages
5,637,662
Members
416,979
Latest member
juliegeorge792

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