Loop

  • Thread starter Thread starter Himszy
  • Start date Start date
H

Himszy

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
 
Try this

dim R as integer
for R 1 to 20
with sheets("SheetName").cells(R,1)
function
end with
next
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top