Recording Macro To Duplicate Page And Rename To Numeric Value [Solved]
Ask a questionShaun@12PostsSunday March 13, 2016Registration date
March 15, 2016
Last seen - Last answered on Mar 15, 2016 10:04AM
I am trying to record a macro that duplicates a page and renaming it to another file name but need to follow in numeric order.
I have an 'Invoice' Excell workbook to invoice my clients.
My current page name is 'Invoice 187' obviously the next one should follow in numeri order: 'Invoice 188'.
I then also have a cell in the document that has the title 'Invoice' and the cell nect to it should have this number as well. The sell is E8.
I do not know how to do this, can someone please help?
The following code will do as requested, even when you reach the 4 digits.
Just make sure you run the code from the latest invoice.
Dim MyNumber As Integer
MyNumber = Right(ActiveSheet.Name, 4) + 1
ActiveSheet.Name = "Invoice " & MyNumber
Range("E8").Value = MyNumber