Add accumulating numbers in a column vba

bongobus

New Member
Joined
Jul 11, 2017
Messages
28
Hi all

I have a macro that copies data to columns b and c

This can range daily in the number of rows

I would like a vba code to input column a

Cell a1 the number 1
Cell a2 the number 2
Cell a3 the number 3

And so on until the column b anc c do not contain any data

So example if nothing in row 50 for b and c
Then a50 equals nothing but a49 equals the number 49

Then this last number being the highest to be copied to let's say d1
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
for j=1 to 100
if cells(j,2)<>"" or cells(j,3)<>"" then cells(j,1)=j:goto 100
cells(1,4)=j:goto 200
100 next j
200 end sub

not tested
 
Upvote 0

Forum statistics

Threads
1,226,730
Messages
6,192,705
Members
453,748
Latest member
akhtarf3

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