View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default apply next number in newly inserted row

The key is that once you have inserted a row, the activecell will be in that
row:

Sub put_it()
ActiveCell.EntireRow.Insert
Set b = Range("B:B")
Cells(ActiveCell.Row, "B").Value = Application.WorksheetFunction.Max(b) + 1
End Sub

--
Gary''s Student - gsnu200828


"KUMPFfrog" wrote:

I have a CommandButton that Inserts a row in a particular location. I would
now like to continue the macro to search col B for the highest number and
then apply the next number to cell of col B in row just inserted. Note - the
numbers in col B are not always in order on the list.

Thanks for any help given