I simply want to switch column data between to adjacent columns IF the column A1 contains a "<" character in it.
this doesn't work at all. As this is the first stuff I've done in excel programming I'd be extremely thankful
Code:
Sub test()
Dim tempval As String
Dim cell As Range
For Each cell In Selection
If cell.Offset(-2, 0).Value = "<" Then
tempval = ActiveCell.Value
ActiveCell.Value = ActiveCell.Offset(-1, 0).Value
ActiveCell.Offset(-1, 0).Value = tempval
End If
Next cell
End Sub
this doesn't work at all. As this is the first stuff I've done in excel programming I'd be extremely thankful