# Walking through a column row by row.

#### bountiful

##### New Member
So hopefully you can see what I'm trying to do. The title pretty much describes it all. Plz halp

Code:
``````Sub changeData()
'Application.ScreenUpdating = False ' faster for modifying values on sheet
Dim numRows As Long
Dim col As Long, y As Long, a As Integer
Dim c As Excel.Range
If Not c Is Nothing Then
col = c.Column
'y = Range(c.Offset(1), c.End(xlDown))
c.Offset(1).Select

Else
' can't work with it
Exit Sub
End If
a = 1
While c(a) <> ""
c(a).Select
If c(a) = c.Offset(a + 1) Then
c(a).Offset(0, 1) = "IT WORKED"
a = a + 1
Else
a = a + 1
End If
' (whatever this is)
Wend``````
you see, my problem is that it's skipping some of the steps that it should do.

### Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

#### RickXL

##### MrExcel MVP
Hi,

I think you are trying to do this:

Code:
``````Sub changeData()
'Application.ScreenUpdating = False ' faster for modifying values on sheet
Dim numRows As Long
Dim col As Long, y As Long, a As Integer
Dim c As Excel.Range
If Not c Is Nothing Then
col = c.Column
'y = Range(c.Offset(1), c.End(xlDown))
c.Offset(1).Select

Else
' can't work with it
Exit Sub
End If
a = 1
While c(a) <> ""
c(a).Select
If c(a) = c.Offset(1) Then
c(a).Offset(0, 1) = "IT WORKED"
a = a + 1
Else
a = a + 1
End If
' (whatever this is)
Wend
End Sub``````

#### bountiful

##### New Member
Hi,

I think you are trying to do this:

I am much closer, It's almost there! thank you for the help!!!

#### Norie

##### Well-known Member

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,684
Messages
5,838,794
Members
430,569
Latest member
sbardelli

### 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.

### Which adblocker are you using?

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

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