kingcashandcarry
Member
I have a macro that copy a sheet of active wb to new wb but only the values and save with timestamp
now i am trying to the new wb to export 2 sheets from the active wb only the values and save with timestamp
the name of sheets are "2018" and "total"
{
Sub Exportminas()
Dim Wb As Workbook
Dim sh As Worksheet
Application.ScreenUpdating = False
For Each sh In ActiveWindow.SelectedSheets
If Wb Is Nothing Then
sh.Copy
Set Wb = ActiveSheet.Parent
Else
sh.Copy After:=Wb.Worksheets(Wb.Worksheets.Count)
End If
ActiveSheet.UsedRange.Value = sh.UsedRange.Value
Next
ActiveWorkbook.SaveAs ("C:\newwb " & Format(Now(), "DD-MMM-YYYY hh mm AMPM") & ".xlsx")
End Sub
now i am trying to the new wb to export 2 sheets from the active wb only the values and save with timestamp
the name of sheets are "2018" and "total"
{
Sub Exportminas()
Dim Wb As Workbook
Dim sh As Worksheet
Application.ScreenUpdating = False
For Each sh In ActiveWindow.SelectedSheets
If Wb Is Nothing Then
sh.Copy
Set Wb = ActiveSheet.Parent
Else
sh.Copy After:=Wb.Worksheets(Wb.Worksheets.Count)
End If
ActiveSheet.UsedRange.Value = sh.UsedRange.Value
Next
ActiveWorkbook.SaveAs ("C:\newwb " & Format(Now(), "DD-MMM-YYYY hh mm AMPM") & ".xlsx")
End Sub