Thread: Looping
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Looping

One way:

Private Sub CommandButton1_Click()
With Selection
If .Row + .Rows.Count = .Parent.Rows.Count Then
.Parent.Cells(1, .Column).Resize( _
.Rows.Count, .Columns.Count).Select
Else
.Offset(1, 0).Select
End If
End With
End Sub


In article ,
"Steve" wrote:

I want to start in cell A1 and each time I click a button on a userForm I
want the cursor to move to the next cell, in this case, a2. Then, if the
cursor is in a2, when the button is clicked again, I would like the cursor to
move to a3.

Any ideas?

Thanks,