Refer­ring Excel cells using For…Next –Loop

For i = 1 to 10

Range(“A” & i).Value = 1


Enter ‘1’ in Cells from A1 to A10.

Refer­ring Columns of excels using For-Loop

For i = 1 To 26

Range(Chr(65 + i) & "1").Value = 2


Enter ‘2’ in cells from A1 to Z1

Refer­ring Excel cells using For…Each…Next –Loop

For Each i In Sheet1.Range("H1:H5")

i.Value = 10


Enter ‘10’ in Cells from H1 to H5.



Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Navigation