Move down the cells in a column

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

What is the code to move down the cells in a column one by one?

Thanks!

Steve
 
What is the code to move down the cells in a column one by one?

Two different approaches to do the same thing...

Sub TestCode1()
Dim R As Range
For Each R In Range("A1:A20")
' Your code goes here in
' place of the following
R.Value = R.Row
Next
End Sub

Sub TestCode2()
Dim X As Long
For X = 1 To 20
' Your code goes here in
' place of the following
Range("B" & CStr(X)).Value = X
Next
End Sub


Rick
 
Rick,

Double thanks here and thanks for the code to move through worksheets!

Steve
 

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

Back
Top