View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
monagan[_6_] monagan[_6_] is offline
external usenet poster
 
Posts: 1
Default if not found, add/insert

Thanks for the Reply, but I've been working on this, and discovered som
other code. I just wanted to know if you had some thoughts on my date
because it cannot seem to find the date that matches. So everytime
add an entry, it adds the date again in row 1.
For instance:

9/15/04 9/15/04 9/15/04 9/15/04
Bob 5
Jen 2.5
Harm 4
Jill
8


Here is my code that is not working: (This first line)

Set fnd = Rows(1).Cells.Find(EDate, , , xlWhole, xlByColumns, xlNext)

If fnd Is Nothing Then
.Range("IV1").End(xlToLeft).Offset(0, 1) = EDate
IntersectCol = .Range("IV1").End(xlToLeft).Offset(0, 1).Column
Else
IntersectCol = fnd.Column
End If

My code for name is very similiar to this and to yours that yo
posted:

'find name
Set fnd = .Range("A2:A" & lRow).Find(EName, , , xlWhole, xlByRows
xlNext)
If fnd Is Nothing Then
.Cells(lRow, 1).Offset(1, 0) = EName
IntersectRow = lRow + 1
Else
IntersectRow = fnd.Row
End If

But this works fine.

Any advice, or tweeking I may have missed

--
Message posted from http://www.ExcelForum.com