Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Various errors

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
knowtrump - 22 Jan 2006 19:12 GMT
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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.