Not sure how to use If Then statements or
Closed
weenie
-
26 Jul 2011 à 00:39
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 28 Jul 2011 à 15:50
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 28 Jul 2011 à 15:50
Related:
- Not sure how to use If Then statements or
- How many if statements can you nest in excel - Guide
- Multiply if statements ✓ - Excel Forum
- Excel if statements with dates - Guide
- How to get sbi bank statement - Guide
- Excel if statement with dates ✓ - Excel Forum
2 responses
RWomanizer
Posts
365
Registration date
Monday 7 February 2011
Status
Contributor
Last seen
30 September 2013
120
26 Jul 2011 à 00:59
26 Jul 2011 à 00:59
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 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
28 Jul 2011 à 15:50
28 Jul 2011 à 15:50
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