Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I using the below to find IF a set of 2 cell values exist in another sheet.
If they Do exist then i need to run say Macro1. If they do NOT exist then i need to run say Macro2. I can't seem to get the ELSE statement correct. Thet either BOTH run or NONE. ~~~~~~~~~~~~~~~~~~~~~~ Sub AlreadyThere() ' Check to see if it Already exists With Workbooks("TSS") ' "Data" Sheet3 is NOT Sheet's "Data" Dim rngFound As Range On Error Resume Next With Worksheets("Data").Range("A:A") Set rngFound = .Find(What:=Sheet4.Range("D2").Value, After:=.Cells(1), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, Matchbyte:=False) If rngFound.Value = Sheet4.Range("D2").Value And rngFound.Offset(0, 1).Value = Sheet4.Range("K2").Value Then ' Do THIS Else: 'DO THAT End If End With End With End Sub ~~~~~~~~~~~~~~~~~~~~~~ I am pretty sure it is a simple matter of getting the ELSE or ELSEIF statement correct to saolve it. Corey.... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF statement inside a SUMIF statement.... or alternative method | Excel Worksheet Functions | |||
Reconcile Bank statement & Credit card statement & accounting data | Excel Worksheet Functions | |||
IF Statement - Correct Function? | Excel Discussion (Misc queries) | |||
Embedding an OR statement in an IF statement efficiently | Excel Discussion (Misc queries) | |||
IF STATEMENT - PLACEMENT OF VALUE IN THE CORRECT CELL | New Users to Excel |