Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code not working

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
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code Not Working tictox Excel Discussion (Misc queries) 3 October 25th 10 04:25 PM
code not working Moh Excel Programming 5 December 18th 07 08:21 AM
Code not working NOW ? But it was before??? Corey Excel Programming 2 August 18th 06 03:30 AM
Code is not working....please take a look!!! tratliff[_12_] Excel Programming 5 August 24th 04 05:45 PM
Vb Code not working bob Excel Programming 3 January 5th 04 01:29 PM


All times are GMT +1. The time now is 06:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"