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
5
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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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