Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default Select rows which satisfy 2 criteria


Hi All

OK thanks to everyone for their help. Much appreciated.



Best Wishes


In article , Gord Dibben
writes
Colin

If you must select try this macro.

Sub Select_Rows()
Dim c As Range, tempR As Range
Set myRng = Range("A1:A100")
'check each cell in the selection
For Each c In myRng
If c < 200 And c.Offset(0, 5).Value = "Green" Then
If tempR Is Nothing Then
'initialize tempR with the first qualifying cell
Set tempR = c
Else
'add additional cells to tempR
Set tempR = Union(tempR, c)
End If
End If
Next c
'display message and stop if no cells found
If tempR Is Nothing Then
MsgBox "There are no Rows " & _
"that meet the criteria."
End
End If
'select qualifying cells
tempR.EntireRow.Select
End Sub


Gord

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
Counting rows that satisfy multiple conditions JRD Excel Worksheet Functions 7 November 26th 09 04:46 AM
select rows and delete based on criteria steven Excel Programming 4 February 15th 07 03:47 PM
Satisfy 2 and more criteria Mark McDonough Excel Worksheet Functions 3 July 28th 06 08:13 AM
Select rows based on criteria sotiris_s Excel Worksheet Functions 4 November 14th 05 12:35 PM
add a column only if 5 other cells on the row satisfy criteria zubin Excel Worksheet Functions 1 September 14th 05 09:27 AM


All times are GMT +1. The time now is 01:52 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"