Can someone fix the following for me?
Dim n as Long
With ActiveSheet
For n = 1865 To 1 Step -1
If (.Cells(n, "d").Value = "S") Then .Cells(n, "e").Select
End If
Selection.TextToColumns Destination:=Range(".Cells(n, "e")),
DataType:=xl _
FixedWidth,FieldInfo:=Array(Array(0, 1), Array(7, 1), Array(14, 1), _
Array(17, 1))
Next n
End With
I get either syntax errors or End If without Block If errors.

Signature
knowtrump
Andrew Houghton - 22 Jan 2006 19:47 GMT
Try this
Dim n As Long
With ActiveSheet
For n = 1865 To 1 Step -1
If (.Cells(n, "d").Value = "S") Then .Cells(n, "e").Select
End If
Selection.TextToColumns Destination:=Range(.Cells(n, "e")),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(7, 1), Array(14, 1), _
Array(17, 1))
Next n
End With
> Can someone fix the following for me?
> Dim n as Long
[quoted text clipped - 10 lines]
>
> I get either syntax errors or End If without Block If errors.
knowtrump - 22 Jan 2006 23:36 GMT
Thanks for the help but I still get the End If without block If error.

Signature
knowtrump
knowtrump - 22 Jan 2006 23:51 GMT
Thanks, ut I still get the End If without block If error.:(
Still looking for help if there are any other view of this.

Signature
knowtrump
Tom Ogilvy - 23 Jan 2006 00:10 GMT
Dim n as Long
With ActiveSheet
For n = 1865 To 1 Step -1
If .Cells(n, "d").Value = "S" Then
.Cells(n, "e").Select
Selection.TextToColumns Destination:=.Cells(n, "e"), _
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), _
Array(7, 1), Array(14, 1), _
Array(17, 1))
End If
Next n
End With

Signature
Regards,
Tom Ogilvy
> Thanks, ut I still get the End If without block If error.:(
>
> Still looking for help if there are any other view of this.
Dave Peterson - 22 Jan 2006 19:49 GMT
Maybe...
Dim n As Long
With ActiveSheet
For n = 1865 To 1 Step -1
If UCase(.Cells(n, "d").Value) = "S" Then
.Cells(n, "e").TextToColumns _
Destination:=.Cells(n, "e"), _
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(7, 1), _
Array(14, 1), Array(17, 1))
End If
Next n
End With
> Can someone fix the following for me?
> Dim n as Long
[quoted text clipped - 16 lines]
> knowtrump's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=19664
> View this thread: http://www.excelforum.com/showthread.php?threadid=503820

Signature
Dave Peterson