Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
If - additional criteria suddengunfire Excel Discussion (Misc queries) 14 July 31st 08 04:00 PM
Subtotal with additional criteria Danni2004 Excel Worksheet Functions 1 April 23rd 08 08:45 PM
SUMPRODUCT - Additional criteria Dewayne Excel Worksheet Functions 2 September 8th 06 06:43 PM
SUMIF/COUNTIF with an additional criteria || cypher || Excel Worksheet Functions 1 November 15th 04 06:42 AM
Additional criteria for a countif statement Lilly[_2_] Excel Programming 0 June 28th 04 07:51 PM


All times are GMT +1. The time now is 04:23 PM.

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

About Us

"It's about Microsoft Excel"