Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Dave, yes this was easier...fear not, next week I attend a VBA Class
for 10 days! Yea! "Dave Peterson" wrote: From the number of similar posts you've made, it kind of looks like you're having trouble with StrComp. Maybe just checking for equal would be easier to understand/implement. LastRow = Cells(Rows.Count, "E").End(xlUp).Row For RowNdx = LastRow To 1 Step -1 If lcase(Cells(RowNdx, "E").value) = lcase("HO") then 'do nothing, it's HO. else cells(rowndx,"E").ClearContents End If Next RowNdx By comparing lcase() with lcase(), it's the same as the vbTextCompare. JOUIOUI wrote: I'm not sure what is wroing with this code, my goal is to clear any text in Column E that does not match "HO". Any help is appreciated. Thanks LastRow = Cells(Rows.Count, "E").End(xlUp).Row For RowNdx = LastRow To 1 Step -1 If StrComp(Cells(RowNdx, "E"), "HO", vbTextCompare) Then Rows(RowNdx)ActiveCell.ClearContents End If Next RowNdx -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trouble Adding VBA Code to Module; Bug in Excel/VBE? | Excel Programming | |||
Trouble Condensing Code | Excel Programming | |||
If than Else Trouble | Excel Worksheet Functions | |||
dim trouble | Excel Discussion (Misc queries) | |||
Print dialog code trouble | Excel Programming |