Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Question about looping


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??

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Question about looping

What is FixedFooter? What is i? I would normally expect a loop to identify a
key column, and identify the last row of that, and loop until the end of
that.

--
__________________________________
HTH

Bob

"Brad" wrote in message
...

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??



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Question about looping

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??

  #4   Report Post  
Posted to microsoft.public.excel.programming
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??

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping question Jase Excel Discussion (Misc queries) 2 March 19th 08 02:03 PM
Looping Question MWS Excel Programming 1 June 5th 06 08:17 PM
Looping question Charles Excel Programming 2 April 20th 05 11:32 PM
Looping Question MWS Excel Programming 3 November 12th 04 05:32 PM
Looping Question MWS Excel Programming 0 October 27th 04 01:49 PM


All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"