• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Loop through cells of current row

NicGreen

Member
Hi Guys,

I'm looking to loop through all cells between column F to Column N of the current row. But for the life of me cannot work out the code. Any ideas?
 
Hi ,

Something like this ?
Code:
Public Sub ProcessCells()
           Startcolumn = "F"
           Endcolumn = "N"
        
           Currrow = ActiveCell.Row
           Set Currrange = Range(Startcolumn & Currrow & ":" & Endcolumn & Currrow)
           For Each cell In Currrange
               MsgBox cell.Address
           Next
End Sub
Replace the MsgBox line with the code you want to use to process each cell.

Narayan
 
That works,

Thanks

I've got to learn a better way to do my For Loops than my current select method. But i'll make another post for that.
 
Back
Top