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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
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,747
Messages
6,132,484
Members
449,729
Latest member
davelevnt

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