Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default A quick one I can't get my head round

Hi experts
At the the moment this script keeps all data that is more that a 1000.
but I don't want to contain data greater than 99999

Help !!!

Dim rngTarget As Range
Dim lRow As Long
Dim lLastRow As Long

With Worksheets("OS")
lLastRow = .Cells(.Rows.Count, 8).End(xlUp).Row
For lRow = 1 To lLastRow
If Not .Cells(lRow, 8).Value "1000" Then
If Not rngTarget Is Nothing Then
Set rngTarget = Application.Union(rngTarget, _
.Cells(lRow, 8).EntireRow)
Else
Set rngTarget = .Cells(lRow, 1).EntireRow
End If
End If
Next lRow
End With

If Not rngTarget Is Nothing Then
rngTarget.Delete shift:=xlUp
Set rngTarget = Nothing
End If


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default A quick one I can't get my head round


If .Cells(lRow, 8).Value < 1000 Then

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Crowbar via OfficeKB.com" <u15117@uwe wrote in message
news:567a88492e1e7@uwe...
Hi experts
At the the moment this script keeps all data that is more that a 1000.
but I don't want to contain data greater than 99999

Help !!!

Dim rngTarget As Range
Dim lRow As Long
Dim lLastRow As Long

With Worksheets("OS")
lLastRow = .Cells(.Rows.Count, 8).End(xlUp).Row
For lRow = 1 To lLastRow
If Not .Cells(lRow, 8).Value "1000" Then
If Not rngTarget Is Nothing Then
Set rngTarget = Application.Union(rngTarget, _
.Cells(lRow, 8).EntireRow)
Else
Set rngTarget = .Cells(lRow, 1).EntireRow
End If
End If
Next lRow
End With

If Not rngTarget Is Nothing Then
rngTarget.Delete shift:=xlUp
Set rngTarget = Nothing
End If


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default A quick one I can't get my head round

Its OK Now

I've figured it out


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1
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
In Over My Head JSnow Excel Discussion (Misc queries) 2 January 17th 09 12:03 AM
over my head James Excel Discussion (Misc queries) 5 June 24th 08 10:06 AM
Cant get my head around this one mbys14932 Excel Worksheet Functions 7 June 9th 06 05:23 PM
Over my head on this one... ChuckF Excel Worksheet Functions 1 April 6th 06 10:57 PM
Quick question - quick answer about assigning shortcut keys funkymonkUK[_75_] Excel Programming 1 October 13th 05 10:50 AM


All times are GMT +1. The time now is 10:02 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"