Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using the following code it works with numbers but not with test, any
suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try makeing each side of the IF statement a UCASE
from If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from
If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from
If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from
If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from
If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from
If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from
If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from
If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from
If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from
If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from
If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
THat doesnt seem to make a difference, it still does not work
"Joel" wrote: from If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#14
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from
If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
#15
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from
If Not UCase(c.Value) = UserForm7.ComboBox4.Text Then to If Not UCase(c.Value) = UCase(UserForm7.ComboBox4.Text) Then "Miree" wrote: I am using the following code it works with numbers but not with test, any suggestions on what is wrong. Thank you Sub MixerTypeFilter() If Not UserForm7.ComboBox4.Text = "" Then Dim MyRange, MyRange1 As Range Lastrow = Cells(Rows.Count, "DU").End(xlUp).Row Set MyRange = Sheets("FormulationsDatabase (2)").Range("DU1:DU" & 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA Code Not Working | Excel Discussion (Misc queries) | |||
code not working | Excel Programming | |||
Code not working NOW ? But it was before??? | Excel Programming | |||
Code is not working....please take a look!!! | Excel Programming | |||
Vb Code not working | Excel Programming |