Not sure how to use If Then statements or
Closed
weenie
-
Jul 26, 2011 at 12:39 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jul 28, 2011 at 03:50 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jul 28, 2011 at 03:50 PM
Related:
- Not sure how to use If Then statements or
- How many if statements can you nest - Guide
- How to download sbi bank statement - Guide
- Excel if statement with text - Guide
- Excel if statements with dates - Guide
- Remove false from if statement ✓ - Office Software Forum
2 responses
RWomanizer
Posts
365
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
120
Jul 26, 2011 at 12:59 AM
Jul 26, 2011 at 12:59 AM
you have to write down two more end if before next i.
I'm still getting complie error Else with out if even after I added the 2 End if before Next i. It highlights in yellow the 1st Else.
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Jul 28, 2011 at 03:50 PM
Jul 28, 2011 at 03:50 PM
You got wrong "With", like With .Range("N" & i).Value = "Pretest Leakage" . You need to only say
.Range("N" & i).Value = "Pretest Leakage"
you can try this
.Range("N" & i).Value = "Pretest Leakage"
you can try this
Sub Macro15()
'To look up values in a column M then enter a text on another column N
Dim LR As Long, i As Long
With Sheets("Failure Data")
LR = .Range("M" & Rows.Count).End(xlUp).Row
For i = 2 To LR
If .Range("N" & i).Value = vbNullString _
Then
Select Case .Range("M" & i).Value
Case Is = 1E+17
.Range("N" & i).Value = "No Break"
Case Is = 1E-17
.Range("N" & i).Value = "Pretest Leakage"
Case Is = 1E+30
.Range("N" & i).Value = "Undefined"
End Select
End If
Next i
End With
End Sub