Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-20-2017, 06:23 AM
NoSparks NoSparks is offline Not process the saving invoice & never go to the next unless complete specific cell Windows 7 64bit Not process the saving invoice & never go to the next unless complete specific cell Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Perhaps this...
Code:
Sub SaveInvWithNewName()

    Dim NewFN
    Dim variable1
    Dim variable2

With ActiveSheet    '<~~ this is the original invoice

    ' are these cells filled in?
    If .Range("F16") = "" Or .Range("E31") = "" Or .Range("G31") = "" Then
        MsgBox "some stuff missing"
        Exit Sub
    End If
    
    variable1 = .Range("A32").Value
    variable2 = .Range("A35").Value
    .Copy   'creates new active workbook containing this invoice
End With

With ActiveSheet    '<~~ now dealing with sheet in newly created workbook
    .Range("A32").Value = variable1
    .Range("A35").Value = variable2
    .Cells.Locked = True
    .Protect
    NewFN = "C:\invoice\" & .Range("I5").Value & .Range("H5").Value & .Range("I49").Value & .Range("F16").Value
End With

With ActiveWorkbook
    .SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook    '<~~ this will add the file extention .xlsx
    Application.DisplayAlerts = True
    .PrintOut From:=1, To:=1, copies:=2
    .Close SaveChanges:=False
End With
    
    Call NextInvoice

End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Not process the saving invoice &amp; never go to the next unless complete specific cell Saving new word documents to specific files maxbeedie Word 1 11-15-2016 04:04 AM
Not process the saving invoice &amp; never go to the next unless complete specific cell How to show planned% complete and actual% complete on the (Project Overview) dashboard report? zislam14 Project 3 12-17-2015 03:03 PM
Saving sent mails to specific folder kammil121 Outlook 0 10-22-2014 02:26 AM
Change Cell Color Based On % Complete jrfoley3 Project 1 05-30-2013 05:24 AM
Not process the saving invoice &amp; never go to the next unless complete specific cell Saving files in a specific path bjtrain83 Word 1 01-10-2010 02:36 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:54 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft