Number in column

someone21

Board Regular
Joined
Sep 16, 2011
Messages
71
I want to have a macro to be put in another worksheet( say Sheet1) to make the Column A of Sheet 2 start from 1, 2,3,4,5,6 depending if the row is empty.

Meaning, if row is not empty, I want a number to be added.

And the 1st row is headings, so no numbering in A1.
 

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
What do you mean by "if the row is empty"? What column(s) do you want to test? By the way you won't need a macro for this - you can use a formula like:

=IF(COUNTA(B2:C2),MAX(A$1:A1)+1,"")
 
Upvote 0
I want a macro for this reason,

The idea is first to see every row from Row 2 till the end of page, and if the row contains some data, I want the column A of the row to be named "1" and so on. So example, the 2nd row with some data, I should get number "2" in the column A of the row.
 
Upvote 0

Forum statistics

Threads
1,224,578
Messages
6,179,650
Members
452,934
Latest member
mm1t1

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