Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Purchase Order Copy and Paste Issue

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Purchase Order Copy and Paste Issue

Seems to work for me. What is the actual address of Range("PONUM")?

"Jeff S." wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy & Paste Issue carrera0000 Excel Discussion (Misc queries) 3 August 17th 07 02:24 AM
Copy Paste issue amwebber Excel Worksheet Functions 3 October 31st 06 02:08 AM
Issue with copy & paste? Etrnal168 Excel Discussion (Misc queries) 2 July 12th 05 03:35 AM
purchase order counter in excel purchase order template Brandy@baoco Excel Worksheet Functions 0 February 23rd 05 06:17 PM
I want a purchase order that includes page number (if to be order. Angela New Users to Excel 1 December 3rd 04 04:39 PM


All times are GMT +1. The time now is 03:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"