Telemedium
04-19-2020, 06:10 PM
Hello I have the following problem : I want a macro that run line by line to check if the value of a cell is a certain something, if it is, the macro should select the next 5 cells in a line and move them right by 1 cell.
For now I have the following code but it won't work:
Sub Movestuff()
'
' Movestuff Macro
'
Dim cell As String
For Each cell.Value In Columns("C:C")
If cell.Value = "OU=" Then
Range("C:G").Select
Selection.Cut Destination:=Range("D:H")
End If
Next cell
End Sub
For now I have the following code but it won't work:
Sub Movestuff()
'
' Movestuff Macro
'
Dim cell As String
For Each cell.Value In Columns("C:C")
If cell.Value = "OU=" Then
Range("C:G").Select
Selection.Cut Destination:=Range("D:H")
End If
Next cell
End Sub