View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Enter Data Macro

Sub codeif()
lr = Cells(Rows.Count, "b").End(xlUp).Row
For Each c In Range("b2:b" & lr)
mv = Left(c, 2)
If mv = 20 Or mv = 30 Or mv = 40 Then
c.Offset(, -1) = Left(c, 1) & "ZZP"
End If
Next c
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MCheru" wrote in message
...
I need help with a macro. Here is what I am trying to do. Search every
cell
in Column B. When the first two numbers are 20 then 2ZZP will be entered
to
the left of that cell in Column A. When the first two numbers are 30
then
3ZZP will be entered to the left of that cell in Column A. When the first
two numbers are 40 then 4ZZP will be entered to the left of that cell in
Column A. Can you help me with this?