I've been tasked with creating an automated Purchase Order form in Excel.
I used an automated invoice tutorial as a place to start, substituting out "invoice number" for "purchase order number".
The purchase order document has been created and my purchase number is set as P000001.
PurchaseOrderSample
I want the purchase order number to automatically increase by one each time a new PO is created.
When I run the macro I get
Run-time error'13': Type mismatch.
Sub CreateNewPO()
Dim purchnum As String
purchnum = Range("I5")
Range("D2:E2,B9,A15:L40").ClearContents
MsgBox "Your next PO number is " & purchnum + 1
Range("I5") = purchnum +1
Range("D2").Select
Thisworkbook.Save
I tried changing the Dim purchnum from As String to As Long.
The error moved from the MsgBox to the purchnum = Range("I5") line.
I tried changing the wording of the MsgBox to using purchase order number, purch number and a few other variations.

P000001) - you can't add 1 to a string.