LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default IF NOT between

I curently have this code which works wonderfully, i need to adapt it to
delete a line if the value in column DW in NOT equal to or between the values
in text boxes 5 and 6 (5 always being less than or equal to 6)

Dim rng As Range
Dim i As Long

Set rng = ActiveSheet.Range(Cells(1, "DW"), Cells(Rows.Count, "DW").End(xlUp))

With rng
For i = .Rows.Count To 1 Step -1
If .Cells(i) = UserForm7.TextBox5 Then
.Cells(i).EntireRow.Delete
End If
Next i
End With

All help very much appreciated

Thanks
 
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



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