Thread: Various errors
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Various errors

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

knowtrump wrote:

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.

--
knowtrump
------------------------------------------------------------------------
knowtrump's Profile: http://www.excelforum.com/member.php...o&userid=19664
View this thread: http://www.excelforum.com/showthread...hreadid=503820


--

Dave Peterson