Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Various errors


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Various errors

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


"knowtrump" wrote
in message ...

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Various errors


Thanks for the help but I still get the End If without block If error.


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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Various errors


Thanks, ut I still get the End If without block If error.:(

Still looking for help if there are any other view of this.


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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Various errors

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

--
Regards,
Tom Ogilvy


"knowtrump" wrote
in message ...

Thanks, ut I still get the End If without block If error.:(

Still looking for help if there are any other view of this.


--
knowtrump
------------------------------------------------------------------------
knowtrump's Profile:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
#DIV errors Sidney Bruce Excel Discussion (Misc queries) 6 May 24th 08 11:55 PM
Excel Throwing Circular Errors When No Errors Exist MDW Excel Worksheet Functions 1 August 10th 06 02:15 PM
Unresolved Errors in IF Statements - Errors do not show in results Markthepain Excel Worksheet Functions 2 December 3rd 04 08:49 AM
#N/A Errors to 0 mikewild2000[_10_] Excel Programming 3 January 29th 04 11:09 PM
VB Help Errors Out Brad[_10_] Excel Programming 0 November 21st 03 10:44 PM


All times are GMT +1. The time now is 01:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"