View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Formula to add a number

When you say open a report I have assumed you mean open a workbook if so try
this

Private Sub Workbook_Open()
Sheets("Sheet1").Select 'Change to suit
oldnum = Left(Range("A1").Value, 7)
x = 1 + Val(Right(Range("A1").Value, Len(Range("A1").Value) - 7))
Range("A1").Value = oldnum & x
End Sub


Mike

"Debbie" wrote:

Can someone give me a formula so that I can have a number added automatically
to a cell each time I open a report.

The number is 10-200-1 and each time I open the report I want it to
automatically populate the fiield with the next number 10-200-2, 10-200-3 and
so on.

Thanks in advavnce for your help,
Deborah