View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default ultiple if Statements

Sub Test()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
If Cells(i,"A").Value = 5120 Then
Cells(i,"B").Value = "Rent"
End If
Next i

End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Newman Emanouel" wrote in message
...
Hello

I need a little help with some vb code.

I have a excel sheet with multiple columns. One particular column has
account numbers say column "A" I need to write some code that will look at
column "A" and if for example cell A1 has "5120" in it then add the word

Rent
into Columb "B".

It sounds really simple but I am having a lot of problems in executing.

Any
help with some code would be very appreciated.

Thanks

Regards

Newman