Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem Copying book


I have this PO system I have been working on for the last few weeks, Ive
got the Salesman part down, now Ive run into a proble with the Receiving
side.

Baisicly when our receiver gets the material if order is complete he
hits a button and it saves a copy with -RC behind the name, this works.
If there is a backorder I need to save a copy of what came in (havent
started this yet) and an additional copy with the Qty Backordered in
the Qty Ordered column with a -1 behind the name.

Ive been going on this so long Im sure its all messed up and any help
would be appreciated. This code runs off a Command button on the
worksheet, that way it stays with the copy.

copy of code: (im new at this so its messy)

Private Sub CommandButton8_Click()
ScreenUpdating = False
Dim Msg, Style, Title, Response, MyString
Msg = "Are you sure you want to complete PO and/or Generate B/O PO?" '
Define message.
Style = vbYesNo ' Define buttons.
Title = "Complete PO" ' Define title.

Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
MyString = "Yes"
mypath = ActiveWorkbook.Path

If Range("BOQty") = 0 Then

Sheet1.CommandButton5.Visible = False
Sheet1.CommandButton8.Visible = False
Range("a1").Select

filesavename = Application.GetSaveAsFilename(ActiveSheet.Range("b 3") &
"-RC" & ".xls")
ActiveWorkbook.SaveCopyAs filesavename

Sheet1.CommandButton5.Visible = True
Sheet1.CommandButton8.Visible = True
'saves original PO
ActiveWorkbook.Close (False)

Else
'determines BO Qty
If Range("BOQty") 0 Then

'select next blank cell
ActiveSheet.Range("o65536").End(xlUp).Offset(1, 0).Select
'Add next PO # -1,-2 ect.
ActiveCell.Value = Range("b3") & "-PO-" & Range("POcount") & ".xls"
'copy sheet with BO
ActiveSheet.Copy

'copy BO Qty to New PO
Range("d15:d34").Copy
Range("b15:b34").PasteSpecial xlPasteValues
Range("c15:c34").Value = ""
Range("d54:d73").Copy
Range("b54:b73").PasteSpecial xlPasteValues
Range("c54:c73").Value = ""
Range("d93:d112").Copy
Range("b93:b112").PasteSpecial xlPasteValues
Range("c93:c112").Value = ""
Range("d132:d151").Copy
Range("b132:b151").PasteSpecial xlPasteValues
Range("c132:c151").Value = ""
Range("d171:d190").Copy
Range("b171:b190").PasteSpecial xlPasteValues
Range("c171:c190").Value = ""

Cells(1).Select
Application.CutCopyMode = False

End If
End If
End If



'Get Save as name
filesavename = Application.GetSaveAsFilename(ActiveSheet.Range("b 3") &
"-PO-" & Range("POcount") & ".xls")

If filesavename < False Then
ActiveWorkbook.SaveAs filesavename
ActiveWorkbook.Saved = True
ActiveWorkbook.Close
Else
If filesavename = False Then
ActiveWorkbook.Close (False)


End If
End If
'Else ' User chose No.
'MyString = "No" ' Perform some action.
'MsgBox.Hide
'End If
'Cells(1).Select
'ActiveWorkbook.Close (True)
ScreenUpdating = True
End Sub


--
Rich Kniatt
------------------------------------------------------------------------
Rich Kniatt's Profile: http://www.excelforum.com/member.php...o&userid=19093
View this thread: http://www.excelforum.com/showthread...hreadid=533429

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
Keeping Workbook Name Out of Sheet When Copying to Different Book navel151 Excel Discussion (Misc queries) 2 April 14th 10 01:02 PM
copying data from one book to another Gareth[_3_] Excel Programming 3 July 10th 05 10:37 PM
Copying multiple sheets from one book 2 another and undertake spec Pank Mehta Excel Discussion (Misc queries) 14 March 16th 05 04:41 PM
Copying multiple sheets to a new book and undertake specialised ed Pank Mehta Excel Discussion (Misc queries) 0 February 8th 05 12:03 PM
Copying Worksheets from one book to another Jonx[_8_] Excel Programming 2 August 17th 04 08:25 PM


All times are GMT +1. The time now is 09:44 AM.

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

About Us

"It's about Microsoft Excel"