Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perfect! Thank you!
"Gary''s Student" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need Help on populating a newly inserted row | Excel Programming | |||
Carrying over formulas into newly inserted row | Excel Discussion (Misc queries) | |||
17 digit number not inserted | Excel Discussion (Misc queries) | |||
Automatically fill one cell in any newly inserted row | Excel Discussion (Misc queries) | |||
Naming a newly inserted sheet using VBA | Excel Discussion (Misc queries) |