HI all
I'm still learning and getting better through tutorials, through this forum and also through exploring Excel VBA.
I have a scenario in which I need some help please. In my main calculation workbook I have some input sheets, and then some output sheets. For one of the output sheets I've written some VBA to copy the values (not the formulas) and then save as a new workbook/sheet. Now I'd like to include a routine to delete the original file.
As I understand it, seeing as I've taken suggestions on each of the steps from various sources, the first part of the code copies the source worksheet just as values and then renames. The second part does the copy and save as work, allowing the user to set a filename. I want to delete the specially created "EaaS PLI and Pricing Form" from the original worksheet but equally need to ensure that the sheet copies to a new file.
Can this even be done with a single click/code? I've been trying to work out where in the code this event should happen, and keep failing! Here's my current code :
Sub Copy_Sheet_Without_Code()
Sheets("PLI Form").Cells.Copy
Sheets.Add.Name = "EaaS PLI and Pricing Form"
Sheets("EaaS PLI and Pricing Form").Cells.PasteSpecial Paste:=xlPasteAll
ThisWorkbook.Sheets("EaaS PLI and Pricing Form").Copy
Dim fname
fname = InputBox("Enter Opportunity Numer")
fname = fname & " EaaS PLI Form.xlsm"
ActiveWorkbook.SaveAs fname, FileFormat:=52
End Sub
Thanks as always
Bookmarks