J
Jeff S.
Hi, Every time run this macro to save the PO, close it, and increment the PO#
on a clear sheet the saved PO shows up blank when I open it. What am I doing
wrong? Here's my code:
Sub CommandButton1_Click()
Dim n As Range
Set n = Range("PONUM")
Application.CutCopyMode = False 'clears the clipboard
Range("A1:G50").Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range("A1")
ActiveWorkbook.SaveAs Filename:="C:\Documents and
Settings\mca.JOMA-NET\Desktop\PO" & n & ".xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Cells(10, 2).Select 'go and park at cell B10 and wait
MsgBox ("Purchase Order was saved as PO" & n & ".xls")
n.Value = n.Value + 1
Range("B34:B39").ClearContents
ActiveWorkbook.Save
End Sub
Thanks.
on a clear sheet the saved PO shows up blank when I open it. What am I doing
wrong? Here's my code:
Sub CommandButton1_Click()
Dim n As Range
Set n = Range("PONUM")
Application.CutCopyMode = False 'clears the clipboard
Range("A1:G50").Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range("A1")
ActiveWorkbook.SaveAs Filename:="C:\Documents and
Settings\mca.JOMA-NET\Desktop\PO" & n & ".xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Cells(10, 2).Select 'go and park at cell B10 and wait
MsgBox ("Purchase Order was saved as PO" & n & ".xls")
n.Value = n.Value + 1
Range("B34:B39").ClearContents
ActiveWorkbook.Save
End Sub
Thanks.