View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Brad Brad is offline
external usenet poster
 
Posts: 846
Default Question about looping

Thank you!!
--
Wag more, bark less


"Jim Thomlinson" wrote:

This should be close to what you want...

Sub DeleteStuff()
Dim nme As Name

For Each nme In ThisWorkbook.Names
With nme
If LCase(Left(.Name, 11)) = "fixedfooter" Then
.RefersToRange.EntireRow.Delete
.Delete
End If
End With
Next nme

End Sub
--
HTH...

Jim Thomlinson


"Brad" wrote:


What I want to do is to put the following two lines in a loop.

shtFixD.Rows("FixedFooter" & i).Delete
ActiveWorkbook.Names("FixedFooter" & i).Delete

Where I know the numbers start with 1 and increment by one. What I don't
know is how many "Footers" I have. How can I do this??