LeonardSterk
New Member
- Joined
- Mar 21, 2021
- Messages
- 33
- Platform
- Windows
Good day,
After browsing many hours on the web and this forums that were very similar, I couldn't get my macro to work nor did I understand what I was doing anymore, hence why I am here to ask for help now...
This works all fine, no errors. Except I don't think I did the extension change wrong, even though it says "xlsx"
Originally, the file is xlsm. When saving as a new copy I want it to be xlsx, yes I know macros won't work then, I want that.
Except, macros DO work. So I think it's still a xslm file but displaying as xlsx.
Long question short:
- Do everything above but make it copy to .xlsx
After browsing many hours on the web and this forums that were very similar, I couldn't get my macro to work nor did I understand what I was doing anymore, hence why I am here to ask for help now...
VBA Code:
Sub Contracts()
ThisWorkbook.Sheets("VGO").Copy `Copy VGO Sheet
ActiveSheet.Name = "Price" `Rename VGO sheet to Price
ActiveWorkbook.SaveAs filename:="G:\Pro\Test\" & Worksheets("Price").Range("Q1") & ".xlsx" `Save file with name that's at sheet Price, cell Q1 and save as xlsx
ActiveWorkbook.Close `Close the new copy, I don't want to see it
MsgBox "The file has been saved at G:\Pro\Test\" & Worksheets("Price").Range("F1"), vbInformation, "VGO" `MsgBox that it's saved
End Sub
This works all fine, no errors. Except I don't think I did the extension change wrong, even though it says "xlsx"
Originally, the file is xlsm. When saving as a new copy I want it to be xlsx, yes I know macros won't work then, I want that.
Except, macros DO work. So I think it's still a xslm file but displaying as xlsx.
Long question short:
- Do everything above but make it copy to .xlsx