View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Murph Murph is offline
external usenet poster
 
Posts: 37
Default Excel loops and If blocks

Hi Team
I am able to get the call for various "runner" macros to meet the specific
number in a cell I have named Starters, but I am unable to put the right End
If or end with or end loop.
Can you see what statements I should include to make this macro continuous.

Sub Count()

Selection.End(xlDown).Select
ActiveCell().Select

Do Until ActiveCell = "Stop"

ActiveWorkbook.Names.Add Name:="Count1", RefersToR1C1:=ActiveCell
Selection.End(xlDown).Select
ActiveCell().Select
ActiveWorkbook.Names.Add Name:="Count2", RefersToR1C1:=ActiveCell
ActiveCell.Offset(0, 1).Select
ActiveCell().Select
ActiveWorkbook.Names.Add Name:="Starters", RefersToR1C1:=ActiveCell
ActiveCell.FormulaR1C1 = "=COUNTA(Count1:Count2)"
Range("Count1:Count2").Select
If "Starters" <= "7" Then
SixRunners
If "Starters" <= "8" Then
SevenRunners
If "Starters" = "15" Then
SixteenRunners


Range("Starters").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveCell.Offset(2, -1).Select
ActiveCell().Select
Do Until ActiveCell = "Stop"
Loop
If ActiveCell = "Stop" Then Cells.Item(257).Select

End Sub
--
Thanks for any help.