I'm a complete beginner at this stuff... hopefully someone can help me here...
I'm using the macro Bill Jelen posted on youtube to generate the next invoice number, however the colors in the cells are changing to other colors when it generates a new saved file...
I added ...
Range("A1:F42").Interior.Color = xlNone
but this clears all the colors out.. which I don't want..
The colors being used are unconventional to the normal format I'm guessing, so this is why they are changing to other colors probably.
can someone show me how to stop the colors from changing, and preserve them, when it creates the new file?
thanks in advance !
Frank
I'm using the macro Bill Jelen posted on youtube to generate the next invoice number, however the colors in the cells are changing to other colors when it generates a new saved file...
I added ...
Range("A1:F42").Interior.Color = xlNone
but this clears all the colors out.. which I don't want..
The colors being used are unconventional to the normal format I'm guessing, so this is why they are changing to other colors probably.
can someone show me how to stop the colors from changing, and preserve them, when it creates the new file?
thanks in advance !
Code:
Sub NextInvoice()
Range("E5").Value = Range("E5").Value + 1
Range("A20:E39").ClearContents
End Sub
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "C:\aaa\Inv" & Range("E5").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
Last edited by a moderator: