LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 91
Default find with six different criteria

I use this one code to find an item with six different criteria, is
there a better way to find an item with multiple criteria?

Sub Button1_Click()
Sheets("Sheet2").Range("G:G").ClearContents
Application.ScreenUpdating = False
Sheets("Sheet1").Range("A1").Select
Do Until ActiveCell.Value = ""
If ActiveCell.Value = Worksheets("Sheet2").Range("A1") Then
If ActiveCell.Offset(0, 1).Value = Worksheets("Sheet2").Range("B2")
Then
If ActiveCell.Offset(0, 2).Value = Worksheets("Sheet2").Range("C2")
Then
If ActiveCell.Offset(0, 3).Value = Worksheets("Sheet2").Range("D2")
Then
If ActiveCell.Offset(0, 4).Value = Worksheets("Sheet2").Range("E2")
Then
If ActiveCell.Offset(0, 5).Value = Worksheets("Sheet2").Range("F2")
Then
Sheets("Sheet2").Range("G6000").End(xlUp).Offset(1 , 0) =
ActiveCell.Offset(0, 6)
End If
End If
End If
End If
End If
End If
ActiveCell.Offset(1, 0).Select
Loop


End Sub

 
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
Macro: Find and replace Bertie Excel Discussion (Misc queries) 1 May 29th 06 02:01 PM
formula to find the filter criteria [email protected] Excel Worksheet Functions 12 December 30th 05 07:04 PM
Find dates in a range; then sum values in that range by a criteria Anders Excel Discussion (Misc queries) 4 October 21st 05 03:41 PM
Trying to find a max value with criteria slot guy Excel Worksheet Functions 1 March 11th 05 04:23 PM
Excel has a "Find Next" command but no "Find Previous" command. Michael Fitzpatrick Excel Discussion (Misc queries) 2 January 10th 05 11:45 PM


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