ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Loop (https://www.excelbanter.com/excel-programming/319758-loop.html)

Himszy

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



Libby

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




Jim May

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






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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com