How can I update the code below so that it doesn't errors out when the workbook contains only one sheet. Some workbooks contain many sheets others contain only one sheet
Sub Test ()
Dim ws As Worksheet
For Each ws In Worksheets
ws.UsedRange.Copy
ws.Range("A1").PasteSpecial Paste:=xlPasteValues
Next ws
Application.CutCopyMode = False
.Save
.Close True
Sub test
Sub Test ()
Dim ws As Worksheet
For Each ws In Worksheets
ws.UsedRange.Copy
ws.Range("A1").PasteSpecial Paste:=xlPasteValues
Next ws
Application.CutCopyMode = False
.Save
.Close True
Sub test