Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I missed a closing paren:
set myrange = .range("DL1:DL" & lastrow should be: set myrange = .range("DL1:DL" & lastrow) Dave Peterson wrote: One mo Sub MixerTypeFilter() Dim MyRange as range dim MyRange1 As Range dim c as range dim LastRow as long with sheets("FormulationsDatabase (2)") lastrow = .Cells(.Rows.Count, "DL").End(xlUp).Row set myrange = .range("DL1:DL" & lastrow end with If UserForm7.ComboBox4.Text < "" Then set myrange1 = nothing For Each c In MyRange.cells If UCase(c.Value) = ucase(UserForm7.ComboBox4.Text) Then If MyRange1 Is Nothing Then Set MyRange1 = c Else Set MyRange1 = Union(MyRange1, c) End If End If Next c If MyRange1 Is Nothing Then 'nothing found to delete else MyRange1.entirerow.Delete End If End If End Sub Miree wrote: I am using the following code, it works fine with numbers but not with text, can anyone help please Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DL").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DL1:DL" & Lastrow) For Each c In MyRange If Not UCase(c.Value) < UserForm7.ComboBox4.Text Then If MyRange1 Is Nothing Then Set MyRange1 = c.EntireRow Else Set MyRange1 = Union(MyRange1, c.EntireRow) End If End If Next If Not MyRange1 Is Nothing Then MyRange1.Delete End If End If End Sub -- Dave Peterson -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Works for number but not text | Excel Programming | |||
Works on numbers but not on TEXT | Excel Programming | |||
filter works on letters not numbers | Excel Discussion (Misc queries) | |||
Formula that works like text-to-column | Excel Worksheet Functions | |||
External link only works for numbers -- for text values, #N/A is displayed unless linked file is open | Links and Linking in Excel |