I am relatively new to VBA. Apologies if I'm not speaking the proper lingo.
I am trying to add a new row (record) to my sheet where each time I add the row, cell b2 will assign a unique ID..
For Instance if cell b2 = 10 when I add a new row b3 would be 10 and B2 would be 11
This is what I have - which is not working:
Each time I run the code it highlights the Activecell line...
[
- Code: Select all
Sub Add_record()
Range("i2").Select
ActiveCell.Offset(1).EntireRow.Insert
Range("b2").Value = Range("b3").Value + 1
End Sub
Would appreciate some assistance with this code or any other ways to incorporate this onto my sheet.
Many Thanks!