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

My Offset syntax is a bit off

PipBoy808

Member
At different intervals in column A (rows 12 to 300) I have the days of the week. I'd like to move those days one column to the right. I wrote the following so that xl might identify only those cells in A12:A300 that contain a value and then offset them to B, but my use of Offset is somehow wrong:

Code:
For i = 12 To 300
If Right(Cells(i, 1).Value, 3) = "day" Then
Range(Cells(i, 1)).Offset(0, 1) = Range(Cells(i, 1)).Value
End If
Next i

Can anyone help me out here?
 
Hi ,

Try this :

Code:
For i = 12 To 300
    If LCase(Right(Cells(i, 1).Value, 3)) = "day" Then
      Cells(i, 2).Value = Cells(i, 1).Value
    End If
Next i
Narayan
 
Hi,

No need Range ! Cells(i, 1).Offset(, 1) but unnecessary with Cells

'cause Cells(i, 2) = Cells(i, 1).Value is far better ‼ Must read integrated help …

Edit : too late !
 
Back
Top