G
Guest
I have a quote system, and all the code below is working and the file saves
correctly. You'll see the code copies the quote into into a new sheet and
saves it. Is there any way I can simply save the current sheet, because with
the current code, I lose all the formatting, and images in the sheet like the
company logo. I'd rather just save the current sheet and retain the
formatting. Would anyone be able to advise how I can re-code this.
Sub MacCreatePO()
Dim n As Range
Dim s As Range
Dim d As Range
Set n = Range("C4")
Set s = Range("B12")
Set d = Range("B16")
Application.CutCopyMode = False
Range("A1:C70").Select
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
ActiveWorkbook.SaveAs Filename:="C:\Documents and
Settings\Administrator\Desktop\dravings\" & n & " " & s & ".xls"
ActiveWorkbook.Close
Cells(1, 1).Select
MsgBox ("Quotation for " & s & " was saved as Quote " & n & " " & s &
".xls")
n.Value = n.Value + 1
ActiveWorkbook.Save
End Sub
correctly. You'll see the code copies the quote into into a new sheet and
saves it. Is there any way I can simply save the current sheet, because with
the current code, I lose all the formatting, and images in the sheet like the
company logo. I'd rather just save the current sheet and retain the
formatting. Would anyone be able to advise how I can re-code this.
Sub MacCreatePO()
Dim n As Range
Dim s As Range
Dim d As Range
Set n = Range("C4")
Set s = Range("B12")
Set d = Range("B16")
Application.CutCopyMode = False
Range("A1:C70").Select
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
ActiveWorkbook.SaveAs Filename:="C:\Documents and
Settings\Administrator\Desktop\dravings\" & n & " " & s & ".xls"
ActiveWorkbook.Close
Cells(1, 1).Select
MsgBox ("Quotation for " & s & " was saved as Quote " & n & " " & s &
".xls")
n.Value = n.Value + 1
ActiveWorkbook.Save
End Sub