Auto numbering VBA code

sangeeta25

Board Regular
Joined
Jun 15, 2015
Messages
59
Hi everyone!

I am currently working on a spreadsheet and I am facing some difficulties in regards to auto numbering.

Basically i have a column which contains consecutive numbers, i.e. cell G9 contains the value 126, G10= 127, G11= 128, G12= 129....etc... so what i would like to do is.. when someone inserts a new row, then cell G13 for instance should automatically contain the text/value 130, and then G14= 131 etc....thus every next G"" cell should only contain the number above the previous G"" cell. Thus i believe that i need a code which i cannot quite figure out.

Could anyone please help me with this?

Thanks!!!

Sangeeta
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Welcome to the Board!

If you convert your data range to a table, then you can use a formula like =ROW()-1 to autonumber column G. As new rows are added the formula will autofill.

HTH,
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,822
Members
449,469
Latest member
Kingwi11y

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top