LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 145
Default speeding up this code

Hi All,

I've got a directory listing dumped into an Excel sheet (created from the
command line with 'dir \s dir.txt'), which i am trying to get in to some
sort of order.

I've created the code below to check for certain text within cells and if
present, delete the containing row. The code works well enough, but as i
have 60,000 rows it is taking a VERY LONG time. is there any way to
significantly speed up this task?

'=========
Sub rowdel()

Dim Tcell As Range, x, y
x = 0
y = 0

For Each Tcell In Selection

If InStr(1, Tcell.Value, "<DIR .") 0 Then
Tcell.Rows.Delete
x = x + 1
End If

y = y + 1
Application.StatusBar = y

Next Tcell

MsgBox x & " lines removed"
Application.StatusBar = False

End Sub

'=========

Thanks for any help,

Tim


 
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
Help speeding up my code Nick Excel Programming 7 December 15th 06 02:49 PM
speeding up copy and paste code cereldine[_18_] Excel Programming 1 April 20th 06 05:36 PM
Help on cleaning / speeding up code Chris Salcedo Excel Programming 2 October 17th 05 01:16 AM
Speeding Up Code [email protected] Excel Programming 8 August 31st 05 04:46 PM
Online Resources for Speeding Up Code orekin Excel Programming 1 July 8th 04 04:09 AM


All times are GMT +1. The time now is 07:31 PM.

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

About Us

"It's about Microsoft Excel"