Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add additional criteria.
I want to add additional values for deletion in the following code. First I
will give you an example of what I want to add. If LCase(Cells(X, 1).Value) = "r","s" Then Rows(X).Delete Private Sub DeleteRows_Click() Dim X As Long Dim Y As Long Y = Range("A65536").End(xlUp).Row 'y= find the last non empty cell in column A For X = Y To 1 Step -1 'Lcase gets the lower case of the word If LCase(Cells(X, 1).Value) = "s" Then Rows(X).Delete End If Next X End Sub Thanks if you can help. Pat |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add additional criteria.
Private Sub DeleteRows_Click()
Dim X As Long Dim Y As Long Y = Range("A65536").End(xlUp).Row 'y= find the last non empty cell in column A For X = Y To 1 Step -1 'Lcase gets the lower case of the word If LCase(Cells(X, 1).Value) = "s" or _ LCase(Cells(X,1).Value) = "r" Then Rows(X).Delete End If Next X End Sub -- Regards, Tom Ogilvy "Pat" wrote in message ... I want to add additional values for deletion in the following code. First I will give you an example of what I want to add. If LCase(Cells(X, 1).Value) = "r","s" Then Rows(X).Delete Private Sub DeleteRows_Click() Dim X As Long Dim Y As Long Y = Range("A65536").End(xlUp).Row 'y= find the last non empty cell in column A For X = Y To 1 Step -1 'Lcase gets the lower case of the word If LCase(Cells(X, 1).Value) = "s" Then Rows(X).Delete End If Next X End Sub Thanks if you can help. Pat |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If - additional criteria | Excel Discussion (Misc queries) | |||
Subtotal with additional criteria | Excel Worksheet Functions | |||
SUMPRODUCT - Additional criteria | Excel Worksheet Functions | |||
SUMIF/COUNTIF with an additional criteria | Excel Worksheet Functions | |||
Additional criteria for a countif statement | Excel Programming |