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

Antonescu

New Member
Joined
Feb 19, 2021
Messages
21
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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
"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 :)
 
Upvote 0

Forum statistics

Threads
1,214,576
Messages
6,120,354
Members
448,956
Latest member
Adamsxl

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