#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default IS Text?

I'm trying to have this piece of code delete rows that non-numeric. I
thought this
would work but it does not run.

Any ideas or other options?
T.I.A.


Sub Step08_Non_Ship()

Dim LastRow As Long
Dim i As Long

LastRow = Range("A12000").End(xlUp).Row
For i = LastRow To 1 Step -1
If IsText(Range("D" & i).Value) Then
Range("A" & i).EntireRow.Delete
End If
Next 'i

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default IS Text?

Change line to: If WorksheetFunction.Istext(Range("D" & i).Value) Then

Ed wrote:
I'm trying to have this piece of code delete rows that non-numeric. I
thought this
would work but it does not run.

Any ideas or other options?
T.I.A.


Sub Step08_Non_Ship()

Dim LastRow As Long
Dim i As Long

LastRow = Range("A12000").End(xlUp).Row
For i = LastRow To 1 Step -1
If IsText(Range("D" & i).Value) Then
Range("A" & i).EntireRow.Delete
End If
Next 'i

End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default IS Text?

try this

LastRow = Range("A12000").End(xlUp).Ro
For i = LastRow To 1 Step -
If WorksheetFunction.N(Range("D" & i).Value) = 0 The
Range("A" & i).EntireRow.Delet
End I
Next '


----- Ed wrote: ----

I'm trying to have this piece of code delete rows that non-numeric.
thought thi
would work but it does not run

Any ideas or other options
T.I.A


Sub Step08_Non_Ship(

Dim LastRow As Lon
Dim i As Lon

LastRow = Range("A12000").End(xlUp).Ro
For i = LastRow To 1 Step -
If IsText(Range("D" & i).Value) The
Range("A" & i).EntireRow.Delet
End I
Next '

End Su



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default IS Text?

"?B?Y2hyaXM=?=" wrote...
try this:

LastRow = Range("A12000").End(xlUp).Row
For i = LastRow To 1 Step -1
If WorksheetFunction.N(Range("D" & i).Value) = 0 Then
Range("A" & i).EntireRow.Delete
End If
Next 'i

...

No, test this! What happens when some cell in column D just happens to evaluate
to zero as a numeric value?

--
To top-post is human, to bottom-post and snip is sublime.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default IS Text?

Well, actually its not supported in VBA anyway
----- Harlan Grove wrote: ----

"?B?Y2hyaXM=?=" wrote..
try this
LastRow = Range("A12000").End(xlUp).Ro

For i = LastRow To 1 Step -
If WorksheetFunction.N(Range("D" & i).Value) = 0 The
Range("A" & i).EntireRow.Delet
End I
Next '

..

No, test this! What happens when some cell in column D just happens to evaluat
to zero as a numeric value

-
To top-post is human, to bottom-post and snip is sublime



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default IS Text?

Would this idea work for you? Not sure if you want to test formulas for
text though, but it's included.

Sub Demo()
Dim Rng As Range
'Use Column A to determine range of Column D
Set Rng = Range([A1], [A12000].End(xlUp)).Offset(0, 3)
On Error Resume Next
Rng.SpecialCells(xlCellTypeConstants, xlTextValues).EntireRow.Delete
Rng.SpecialCells(xlCellTypeFormulas, xlTextValues).EntireRow.Delete
ActiveSheet.UsedRange
End Sub

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Ed" wrote in message
...
I'm trying to have this piece of code delete rows that non-numeric. I
thought this
would work but it does not run.

Any ideas or other options?
T.I.A.


Sub Step08_Non_Ship()

Dim LastRow As Long
Dim i As Long

LastRow = Range("A12000").End(xlUp).Row
For i = LastRow To 1 Step -1
If IsText(Range("D" & i).Value) Then
Range("A" & i).EntireRow.Delete
End If
Next 'i

End Sub




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
Using TEXT and &TEXT - display numbers with commas, underline text Gary Excel Discussion (Misc queries) 3 May 5th 23 03:46 AM
Sumif text is contained winthin a longer text string in a cell Johnny M[_2_] Excel Worksheet Functions 3 March 21st 07 02:50 PM
Text does not display in "Text boxs" and when wrapping text in a c Esteban Excel Discussion (Misc queries) 1 March 8th 07 11:59 PM
Counting a mixed text/number column based on text in another colum Sierra Vista Steve Excel Discussion (Misc queries) 3 December 17th 06 05:30 PM
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' Dan E[_2_] Excel Programming 4 July 30th 03 06:43 PM


All times are GMT +1. The time now is 09:20 AM.

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"