View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Matt[_33_] Matt[_33_] is offline
external usenet poster
 
Posts: 78
Default Repeat Macro until Empty Cell Reached

I modified it like this:


Sub ED()
Do
ActiveCell.Value = Mid(ActiveCell.Value, 6)
ActiveCell.Offset(1, 0).Select
If IsEmpty(ActiveCell) Then
Exit Do
End If
Loop

ActiveCell.Value = "END"
ActiveCell.Offset(0, 1).Select
Do
ActiveCell.Value = Mid(ActiveCell.Value, 6)
ActiveCell.Offset(-1, 0).Select
If IsEmpty(ActiveCell) Then
Exit Do
End If
Loop
ActiveCell.Offset(0, -1).Select
ActiveCell.Value = "START"

End Sub


Now what this does is it goes down until it finds an empty cell, then
goes right and then up until it finds an empty cell and left again.

Now this lets me find my range of used cells.

How can I now make a function which selects all cells between the cell
that say START and END and make a graph from that?

I really know nothing about VBA :( need help.

Matt