loop through column

neveu

Board Regular
Joined
Jan 27, 2009
Messages
225
hi,

i would need to loop through a column and see if there are data in the cells as follows:

to go to range E5:F5 and count if there is information in the range
then do the same thing for range E5:F5,
E5:G5
E5:H5
E5:I5 and so on up to
E5:BB5


can you please help me. i have no idea how to loop through letters.

thank you
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hello.

You can loop through columns as a number. You can look in a cell by the following:

Code:
Dim i as Long
Dim iCounter as Long

For i = 5 to 10
    If ActiveWorksheet.Cells(5,i) <> "" Then
        iCounter = iCounter + 1
    End If
Next i

This will loop through row 5 of columns E through J.

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,473
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top