Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default can someone explain what the below macro does

hi i found the below code that seaches col b for any cell that
contains the word verifiers and deletes the enrire row if found
but can someone explain how it does it
i understand most of it but i cant get my head round thr step -1 part

cheers


Sub del_row()
Dim rw As Integer
Dim Word As String
Word = "Verifiers"

For rw = 2000 To 2 Step -1
If InStr(2, ActiveSheet.Cells(rw, 2).Value, Word, vbTextCompare)
Then Cells(rw, 2).EntireRow.Delete
Next rw
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default can someone explain what the below macro does

Step -1 just means to increment the counter by -1. So here it means start
the loop with row 2000 and count backwards (row 1999, 1998 etc) until row 2.
For more, Search VBA help for explanation of for next loops.

Bob L.


"aneurin" wrote in message
om...
hi i found the below code that seaches col b for any cell that
contains the word verifiers and deletes the enrire row if found
but can someone explain how it does it
i understand most of it but i cant get my head round thr step -1 part

cheers


Sub del_row()
Dim rw As Integer
Dim Word As String
Word = "Verifiers"

For rw = 2000 To 2 Step -1
If InStr(2, ActiveSheet.Cells(rw, 2).Value, Word, vbTextCompare)
Then Cells(rw, 2).EntireRow.Delete
Next rw
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
Not sure how to explain.... Tricia LeAnn[_2_] Excel Discussion (Misc queries) 12 January 18th 08 07:14 PM
explain this one to me.... Dave F Excel Discussion (Misc queries) 10 November 16th 06 11:05 PM
How to explain??... tagr Excel Discussion (Misc queries) 2 March 18th 06 03:34 AM
Let me see if I can explain this... jsc3489 Excel Worksheet Functions 0 July 22nd 05 05:04 PM
Explain these please Sal Excel Worksheet Functions 1 March 24th 05 08:43 PM


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