View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default How do you add 1 to an invoice number in Excel. Formula for this?


"GregR" wrote in message
ps.com...
Bob, this is what I have in the ThisWorkbook code module:

Evaluate(ThisWorkbook).Names("UniqueId").RefersTo ("Inv")
Private Sub Workbook_Open()
GetId
End Sub
Private Sub GetId()

Dim myId As Long

myId = 1 ' in case it doesn't already exist
On Error Resume Next
myId = Evaluate(ThisWorkbook.Names("UniqueId").RefersTo) + 1
ThisWorkbook.Names.Add Name:="UniqueId", RefersTo:="=" & myId

End Sub

I have named "F4" with "Inv". I am sure I missed something, but not
sure what? TIA


What does the last sentence mean exactly, and what is/is not happening?