Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Need loop help.

ok, I have code that will copy a sheet from on workbook to another. Now I
need to repeat that process over and over.

I need to look at c6 through c-29. When the cell it looks at isn't blank, I
need it to run my code. When it is blank (end of the list) I need it to stop.

Any help? I really appreciate it.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Need loop help.

Seems straightforward. This should work. If your code is already in
a self-contained subroutine, just put in the name of your sub in place
of 'your code here. HTH, James
Sub Test()
For k=6 to 29
if cells(k,"c")="" then
exit for
else
'your code here
end if
Next k


On Jul 5, 12:02?pm, Jeremy wrote:
ok, I have code that will copy a sheet from on workbook to another. Now I
need to repeat that process over and over.

I need to look at c6 through c-29. When the cell it looks at isn't blank, I
need it to run my code. When it is blank (end of the list) I need it to stop.

Any help? I really appreciate it.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Need loop help.

Thanks

"Zone" wrote:

Seems straightforward. This should work. If your code is already in
a self-contained subroutine, just put in the name of your sub in place
of 'your code here. HTH, James
Sub Test()
For k=6 to 29
if cells(k,"c")="" then
exit for
else
'your code here
end if
Next k


On Jul 5, 12:02?pm, Jeremy wrote:
ok, I have code that will copy a sheet from on workbook to another. Now I
need to repeat that process over and over.

I need to look at c6 through c-29. When the cell it looks at isn't blank, I
need it to run my code. When it is blank (end of the list) I need it to stop.

Any help? I really appreciate it.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Need loop help.

Lots of answers

for RowCount = 6 to 29
if isemptry(cells(RowCount,"C")) then exit for

Next RowCount

"Jeremy" wrote:

ok, I have code that will copy a sheet from on workbook to another. Now I
need to repeat that process over and over.

I need to look at c6 through c-29. When the cell it looks at isn't blank, I
need it to run my code. When it is blank (end of the list) I need it to stop.

Any help? I really appreciate it.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Need loop help.

This may work:-

Right clicjk the sheet tab - view code and paste in

Sub stantiate()
Dim myRange As Range
Set myRange = Range("C6:C29")
For Each c In myRange
If c.Value < "" Then
'<Do your stuff here
End If
Next
End Sub

Mike

"Jeremy" wrote:

ok, I have code that will copy a sheet from on workbook to another. Now I
need to repeat that process over and over.

I need to look at c6 through c-29. When the cell it looks at isn't blank, I
need it to run my code. When it is blank (end of the list) I need it to stop.

Any help? I really appreciate it.



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
Naming Worksheets - Loop within a loop issue klysell Excel Programming 5 March 29th 07 05:48 AM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 0 March 27th 07 11:17 PM
(Complex) Loop within loop to create worksheets klysell Excel Programming 1 March 20th 07 12:03 AM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM


All times are GMT +1. The time now is 12:07 AM.

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

About Us

"It's about Microsoft Excel"