View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
joel[_21_] joel[_21_] is offline
external usenet poster
 
Posts: 1
Default Macro analyses Cell.Serches for given word,the puts text in cell a


Microsoft and thecodeCage cross post submissions. Posting on one site
will automatically show up on the other site. The email is sent from
the site you orginally put the request. The microsoft site is
presently not working porperly. Emails are not being sent when
responses are posted. I think I responed on both sites to this
request.

the code below starts at the last row since you have blank cells in the
data and you are adding new rows.


Sub UnknownProduct()

LastRow = Range("A" & Rows.Count).End(xlUp).Row
RowCount = LastRow
Do While RowCount 1
Data = Range("A" & RowCount)
If Data = "Price" Then
PreviousData = Range("A" & (RowCount - 1))
If PreviousData = "Code" Then
Rows(RowCount).Insert
RowCount = RowCount - 1
Range("A" & RowCount) = "unknown product"
End If
End If

RowCount = RowCount - 1

Loop

End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=145279