Results 1 to 2 of 2

After saving the invoice with new name using VBA code colors and format change

Threaded View

  1. #1
    Registered User
    Join Date
    06-23-2013
    Location
    United Arab Emirates
    MS-Off Ver
    Excel 2007
    Posts
    1

    After saving the invoice with new name using VBA code colors and format change

    Hi All,

    i was trying to generate the auto number and save the invoice by using the vba module. The code is below. It works ok but the only problem is that after creating the new file all colors and cell format automatically change. I want to have the same format in new file also can any body help me in this regard.

    Sub NextInvoice()
        Range("G8").Value = Range("G8").Value + 1
        Range("B13:G17,B20:G27").ClearContents
    End Sub
    
    Sub SaveInvWithNewName()
        Dim NewFN As Variant
        ' Copy Invoice to a new workbook
        ActiveSheet.Copy
        NewFN = "C:\Users\Finance\Documents\Data\DIS Data\Inv" & Range("G8").Value & ".xlsx"
        ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
        ActiveWorkbook.Close
        NextInvoice
    End Sub
    Last edited by poras; 06-23-2013 at 07:06 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1