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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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,215,062
Messages
6,122,923
Members
449,094
Latest member
teemeren

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