Vba to save specific sheet from my workbook only as value and formating

MoKDiab

New Member
Joined
Dec 15, 2021
Messages
10
Office Version
  1. 2019
Platform
  1. Windows
Hello
I've tried many codes to make a macro to save my sheet with only value and formating I found one that works great but I faced one problem that the new saved sheet is from left to right and my source one is from right to left so I need your help to modify this code to save from right to left like the source sheet
This the code I used

plementing Fullscreen mode would be more complicated. Full screen mode affects the instance of the Excel application, not the individual workbooks. In order to do that, you would need to have this procedure enter an workbook_open procedure in the DestBook workbook module to set Application.DisplayFullScreen = True. You probably would want an workbook_BeforeClose procedure to set it to False. This would require the user accepting the macro warning when opening the file.

Code:
Sub SaveValues()
Dim SourceBook As Workbook, DestBook As Workbook, SourceSheet As Worksheet, DestSheet As Worksheet

Dim SavePath As String, i As Integer

Application.ScreenUpdating = False

Set SourceBook = ThisWorkbook

'*********************************************
'Edit next two lines as necessary
SavePath = Sheets("Sheet1").Range("F7").Text
Set SourceSheet = SourceBook.Sheets("Sheet3")
'*********************************************
Set DestBook = Workbooks.Add
Set DestSheet = DestBook.Worksheets.Add

Application.DisplayAlerts = False
For i = DestBook.Worksheets.Count To 2 Step -1
DestBook.Worksheets(i).Delete
Next i
Application.DisplayAlerts = True

SourceSheet.Cells.Copy
With DestSheet.Range("A1")
.PasteSpecial xlPasteValues
.PasteSpecial xlPasteFormats 'Delete if you don't want formats copied
End With

DestSheet.Name = SourceSheet.Name
DestBook.Activate
With ActiveWindow
.DisplayGridlines = False
.DisplayWorkbookTabs = False
End With
SourceBook.Activate

Application.DisplayAlerts = False 'Delete if you want overwrite warning
DestBook.SaveAs Filename:=SavePath
Application.DisplayAlerts = True 'Delete if you delete other line

SavePath = DestBook.FullName
DestBook.Close 'Delete if you want to leave copy open
MsgBox ("A copy has been saved to " & SavePath)

End Sub


Thanks
 
I want it to save every tab individually but in the same workbook
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I want it to save every tab individually but in the same workbook
Yes, sorry I misunderstood, and put all sheets into the one worksheet.

I'll post back later today (it's morning here) unless someone else wants to jump in.
 
Upvote 0
Thank you for your help
Sorry that I'm taking a lot of your time
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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