Excel Macro for Serial Number

Jyotirmaya

Board Regular
Joined
Dec 2, 2015
Messages
214
Office Version
  1. 2019
Platform
  1. Windows
I have data in my sheet from B6 onwards, I want a macro that if in the B column any Text or value will be there then automatically serial number should be inserted starting from 1 in A column against the B column Text or value & it will be better if in the macro I can input the range of B where the code will work.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Here's a way without a macro.

Put the following formula in A6 and drag down :

=IF(B6="","",COUNTA(B$6:B6))
 
Upvote 0

Forum statistics

Threads
1,225,767
Messages
6,186,911
Members
453,386
Latest member
testmaster

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