Can someone please tell this newb what he's doing wrong?
i can't get either of these to work :o(
Sub Format_Data()
Dim i As Long
i = 1
Do While Cells(2, i) < ""
If InStr(1, Cells(1, i), "Sedol", vbTextCompare) Then
Columns(i).Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Else
i = i + 1
End If
Loop
End Sub
----------------------------------------------------------------------------------------------------------------
Sub Format_Data2()
Dim rCell As Range, i As Long
i = 1
Do
Set rCell = Nothing
Set rCell = ActiveSheet.Columns(i).Find("Sedol", , xlValues,
xlPart)
If Not rCell Is Nothing Then
rCell.EntireColumn.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
End If
Loop While Not rCell Is Nothing
Exit Sub
NoneFound:
MsgBox "Sedols Not Found"
End Sub
|