#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Loop

I want to create a loop that will repeat on cells A1:A20. I've written the
if function for it I just need help on the loop. Any ideas?

Thanks Michael


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 151
Default Loop

Try this

dim R as integer
for R 1 to 20
with sheets("SheetName").cells(R,1)
function
end with
next

"Himszy" wrote:

I want to create a loop that will repeat on cells A1:A20. I've written the
if function for it I just need help on the loop. Any ideas?

Thanks Michael



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Loop

Sub Tester()
Set rng = Range("A1:A20")
For Each c In rng
MsgBox "My Loop is currently at Cell address " & c.Address
'replace with whatever you want to do with each cell
Next c
End Sub

"Himszy" wrote in message
k...
I want to create a loop that will repeat on cells A1:A20. I've written the
if function for it I just need help on the loop. Any ideas?

Thanks Michael




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
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
DO LOOP in VBA Brettjg Excel Discussion (Misc queries) 5 April 24th 07 12:42 AM
getting out of a if loop rk0909 Excel Discussion (Misc queries) 3 April 11th 06 03:55 PM
Worksheet_Change - loop within a loop bgm Excel Programming 1 January 19th 04 01:27 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 06:23 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"