Itemize a colum and fill down

J

johncaleb

Hi,
I have a data range from A1:D10
Is there a macro to remove all data from column C, then
itemize down "10,9,8,7,6,5,4,3,2,1" starting at C1?
Note, the number of rows can change from 10 to any amount later.

thanks.
 
J

JLGWhiz

This should do it:

Sub tract()
Dim sh As Worksheet, lr As Long
Set sh = ActiveSheet
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row
sh.Range("C1:C" & lr).ClearContents
sh.Range("C1") = lr
For i = 2 To lr
sh.Cells(i, 3) = sh.Cells(i - 1, 3).Value - 1
Next
End Sub
 
J

JLGWhiz

Don't you itemize down, Don? Lot's of people do that. Some do it starting
with one and work up, and others do it starting with a higher number and
work down to one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top