Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I can't figure out why this macro isn't working right. In my group we have user id's which are letter and number combos. I wanted to write up a macro in which I can take any list any size and select the user id's and it will filter the results to just our id's. I wrote this but it seems as though it's skipping rows. I can't figure it out. Code: -------------------- Option Explicit Public Sub COLUMN_UNIT_CODE() Dim cell 'Application.ScreenUpdating = False For Each cell In Selection cell.NumberFormat = "@" If cell.Value < "2A" Then If cell.Value < "7G" Then If cell.Value < "D1" Then If cell.Value < "D2" Then If cell.Value < "D6" Then If cell.Value < "F3" Then If cell.Value < "H1" Then If cell.Value < "H5" Then If cell.Value < "M1" Then If cell.Value < "M4" Then If cell.Value < "M6" Then If cell.Value < "G5" Then cell.EntireRow.delete End If End If End If End If End If End If End If End If End If End If End If End If Next cell End Sub -------------------- -- DKY ------------------------------------------------------------------------ DKY's Profile: http://www.excelforum.com/member.php...o&userid=14515 View this thread: http://www.excelforum.com/showthread...hreadid=399226 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
delete every nth row in selected range | Excel Discussion (Misc queries) | |||
Macro run if and cell in range is selected in VBA | Excel Programming | |||
Macro run if and cell in range is selected in VBA | Excel Programming | |||
TO TOM OR KEN: macro to calculate selected range | Excel Programming | |||
Need a macro to delete selected rows | Excel Programming |