View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ina ina is offline
external usenet poster
 
Posts: 120
Default if statement problem

Hello all,

I have a problem he

For each cell in my range I would like to look for this words:
Some value has the word EUR and others USD.

If (Intstr = Application.WorksheetFunction.Search("USD",
MyCell.Value)) Then
ActiveCell.Offset(0, 2).Value = Mid(MyCell.Value, 1, Intstr
- 1)

ElseIf (Intstr = Application.WorksheetFunction.Search("EUR",
MyCell.Value)) Then
ActiveCell.Offset(0, 2).Value = Mid(MyCell.Value, 1, Intstr
- 1)

End If

I have an error here because it executes the two if and the same time.


Thanks,

Ina