I want to save activated worksheet at given folder path and want to save in tab with specific worksheet name using VBA macro

sanju1988

New Member
Joined
Jun 12, 2022
Messages
10
Office Version
  1. 2021
  2. 2019
  3. 2016
Platform
  1. Windows
I want to save activated worksheet at given folder path and want to save in tab with specific worksheet name using VBA macro and want to delete activated worksheet again.as i am doing this for number of files and also i want to add wrap text =true and row height set 12.75 Tried below code

Code I tried

Set wb = Workbook.Add
Activeworkbook.SaveAs Filename : "G:\expected file name.xls",FileFormat:=xlOpenXMLWorkbook
ThisWorkbook.Sheets("template").Activate
ThisWorkbook.Sheets(Array(template")).Move Before:=Workbooks("template").Sheets(1)
Sheets(2).Delete
ActiveWorkbook.Save
Windows(Foldername to save)


Here my requirement is i want save activated worksheet which is template ,i want to save this template at "G:/folder1" with filename XYZ.xls and with tab name 'Region1'

and also want to print date from last monday to last sunday date in Cell B5 with format YYYYMMDD
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
i want to add wrap text =true and row height set 12.75 except 1st five rows
I want to print date from last monday to last sunday date in Cell B5 with format YYYYMMDD and i want to remove gridlines from sheet.
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

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