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 finding next number in a sequence

Hi,

You didn't say which sheet so this uses sheet1, change to suit.

You can either use this as a workbook open macro (as posted) or put it in
macro of your own

Private Sub Workbook_Open()
Sheets("Sheet1").Select
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Cells(lastrow, 1).AutoFill Destination:=Range("A" & lastrow & ":A" & lastrow
+ 1)
End Sub

Mike

"Bobbo" wrote:

I am looking to create a macro that will allow me to open a spreadsheet and
search column A for the last entry. The entries in the column are like
CE000001, CE000002, CE000003 and on. I need to be able to find the last
number that was used. After getting the number I will need to insert a new
number in sequence to the next row. Could you point me to some examples that
might help.

Thanks
Bob