Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi SanFranGuy06,
I slightly adapted your first procedu '============= Public Sub Format_Data() Dim i As Long i = 2 Do While Cells(2, i).Value < "" If InStr(1, Cells(1, i), "Sedol", vbTextCompare) Then Columns(i).Cut Columns("A:A").Insert Shift:=xlToRight End If i = i + 1 Loop End Sub '<<============= --- Regards, Norman "SanFranGuy06" wrote in message ups.com... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help a newb.... | Excel Discussion (Misc queries) | |||
Complete newb, I know! | Excel Programming | |||
i know this has to be so easy -newb | Excel Discussion (Misc queries) | |||
VBA newb needing help with an IF | Excel Programming | |||
VBA newb needing help with an IF | Excel Programming |