Macro to save concatenate names

Tigrou25

New Member
Joined
Nov 22, 2018
Messages
14
Hi all,

I have created a macro to extract few tabs from a spreadsheet and save a new spreadsheet.

I would like to save the new file using the month in the tab "Control_Page" (in cell B12).

I have tried the code below
ActiveWorkbook.SaveAs Filename:= _
"1. " & sheets("Control_Page".Range("B12")&" Monthly P&L Review.xlsx"
which doesn't work.

The idea would be to have the following file name
1. Oct 18 Monthly P&L Review.xlsx
with Oct18 being cell B12 in the tab "Control_Page"

Thanks for your help
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi there,

I now try to overwrite the file when I save it.

I have put the following code but it doesn't work, it asks me if I want ro replace the file.

Code:
Application.DisplayAlerts = False
I have also tried
Code:
ActiveWorkbook.Application.DisplayAlerts = False

Here the full code
Code:
ActiveWorkbook.SaveAs Filename:= _        "S:\Construction\National - Head Office\A Profit and Loss\A01 FY Budgets\08. FY19 P&L\1.Monthly P&L Review\Excel\1. NAT CONST CMT P&L.xlsx" _
        , FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
 ActiveWorkbook.Application.DisplayAlerts = False
        ActiveWindow.Close
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,806
Members
449,048
Latest member
greyangel23

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