Ricasilva13
New Member
- Joined
- May 31, 2019
- Messages
- 1
Good morning,
I have a problem with a macro that runs in windows 7 but on windows 10 it runs with a small problem.
Macro:
Sub XXX()
'
' Macro1 Macro
'Sheet of the activeworkbook that you want save as separated workbook
Sheets("XXXXXXX").Copy
Dim Path As String
Dim filename As String
ActiveWorkbook.SaveAs filename:=Range("A2").Value & " - " & Range("D5").Value & ".xlsx", FileFormat:=xlOpenXMLWorkbook
Columns("A:H").Select
Columns("A:H").Copy
Columns("A:H").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
So on windows 7 if i run the macro, it will open the sheet that im working on and save with the name on the cells A2 - D5.
But on windows 10 instead of saving with the name on the cells A2 - D5, we creates a folder with the name in A2 and then saves the file with the name on D5.
Best regars
Ricardo Silva
I have a problem with a macro that runs in windows 7 but on windows 10 it runs with a small problem.
Macro:
Sub XXX()
'
' Macro1 Macro
'Sheet of the activeworkbook that you want save as separated workbook
Sheets("XXXXXXX").Copy
Dim Path As String
Dim filename As String
ActiveWorkbook.SaveAs filename:=Range("A2").Value & " - " & Range("D5").Value & ".xlsx", FileFormat:=xlOpenXMLWorkbook
Columns("A:H").Select
Columns("A:H").Copy
Columns("A:H").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
So on windows 7 if i run the macro, it will open the sheet that im working on and save with the name on the cells A2 - D5.
But on windows 10 instead of saving with the name on the cells A2 - D5, we creates a folder with the name in A2 and then saves the file with the name on D5.
Best regars
Ricardo Silva